Skip to main content

Domain Model

The Bartendie domain model outlines the core concepts, entities, and relationships within the home bar organization system. It provides a comprehensive view of the system's structure using UML class diagrams.

What is a Domain Model?

A domain model is a conceptual model of a system that describes:

  • Entities: Objects with identity that persist over time
  • Value Objects: Immutable objects defined by their attributes
  • Aggregates: Clusters of entities and value objects treated as a unit
  • Relationships: How different objects relate to each other
  • Methods: Behaviors associated with the objects

Domain Overview

Bartendie is structured around several key domains:

  • Event Planning: Creating and managing events, guest lists, and themes
  • Menu Management: Designing balanced menus for events
  • Recipe Management: Storing and organizing cocktail recipes
  • Inventory Management: Tracking bar stocks and generating shopping lists
  • Bar Setup: Managing tools, equipment, and glassware for events

The Bartendie Domain Model

The diagram below shows the full domain model for the Bartendie system:

Core Aggregates

The Bartendie system is organized around several key aggregates:

Event Aggregate

The Event Aggregate represents a planned cocktail event, including:

  • Event: The main entity with date, name, and description
  • Theme: Value object defining the event's stylistic concept
  • GuestList: Collection of guests with preferences and RSVP status
  • AttendanceEstimate: Projection of expected attendance

Events are the central organizing concept in Bartendie, providing context for menus, guest preferences, and bar setup.

Venue Aggregate

The Venue Aggregate represents physical locations where events take place.

  • Venue: The root entity for a physical location, including its address and available facilities. The venue manages multiple bars and storage areas within its boundaries.
  • Storage: A designated area within a venue for storing inventory (e.g., dry storage, cold storage).
  • Bar: A specific bar area within a venue that can be set up for an event. Each bar has a unique identity, name, description, and features that define its capabilities.

Bar Entity Details

The Bar entity represents a physical bar location within a venue and includes:

Attributes:

  • BarId: Unique identifier for the bar
  • Name: Descriptive name (e.g., "Main Bar", "Kitchen Counter Bar")
  • Description: Optional detailed description of the bar's characteristics
  • VenueId: Reference to the parent venue
  • Features: List of bar capabilities (e.g., "Full Service", "Wine Bar", "Coffee Station")

Behaviors:

  • CreateBar(): Initialize a new bar within the venue
  • UpdateBar(): Modify bar details and features

Relationship to Venue: Bars exist within the composition boundary of a Venue. A venue can contain multiple bars, but each bar belongs to exactly one venue. The venue is responsible for managing the lifecycle of its bars through the AddBar() and RemoveBar() methods.

Venues provide the physical context for events and contain the spaces used for storage and service.

The Menu Aggregate represents a curated collection of drinks for an event:

  • Menu: The main entity containing drink items
  • DrinkItem: Individual cocktail offerings on a menu
  • FlavorProfile: The overall flavor balance of the menu

Menus are linked to events and contain references to recipes that will be served.

Recipe Aggregate

The Recipe Aggregate defines how to prepare specific cocktails:

  • Recipe: The main entity with ingredients, instructions, and preparation details
  • RecipeIngredient: Specific ingredient with quantity and unit measurements
  • RecipeBalance: Analysis of flavor components (sweet, sour, bitter, etc.)
  • RecipeTool: Mapping between recipes and required tools
  • BatchRecipe: Scaled version of a recipe for multiple servings

Recipes are the foundation of drink preparation and are referenced by menu items.

Inventory Aggregate

The Inventory Aggregate tracks all available bar ingredients and tools:

  • Inventory: The main entity managing all available items
  • Product: Specific item in inventory with brand, type, and quantity
  • Ingredient: Component used in recipes, mapped to products
  • ShoppingList: Needed items based on planned menus and current inventory

The inventory system allows tracking of stock levels and generation of shopping lists based on planned menus.

Bar Setup Aggregate

The Bar Setup Aggregate defines the physical arrangement and tools needed for an event:

  • BarSetup: The main entity defining layout and required items
  • BarTool: Specific implement for drink preparation
  • Equipment: Larger items required for bar operation
  • Glassware: Specific vessels for serving drinks

Bar setup ensures that all necessary tools and equipment are available for an event.

Batched Cocktail Aggregate

The Batched Cocktail Aggregate manages pre-made cocktails for events:

  • BatchedCocktail: The main entity representing prepared batches
  • BatchRecipe: Modified recipe for large-scale preparation
  • BatchIngredient: Scaled ingredient quantities for batch preparation

Batched cocktails help in efficient service during events by allowing preparation in advance.

User Management Aggregate

The User Management Aggregate handles authentication, authorization, and user profiles:

  • User: The main entity representing a system user with authentication credentials and profile information
  • UserProfile: Value object containing personal information and preferences
  • Role: Entity defining user roles with associated permissions
  • Permission: Value object defining specific access rights to resources and actions

This aggregate ensures secure access to the system and proper authorization for different user types (hosts, bartenders, administrators).

Notification Aggregate

The Notification Aggregate manages system communications and alerts:

  • Notification: The main entity representing messages, alerts, and reminders sent to users

This aggregate handles various types of notifications including inventory alerts, event reminders, and system messages.

Audit Aggregate

The Audit Aggregate provides comprehensive tracking and history:

  • AuditLog: The main entity recording all system operations, changes, and user actions

This aggregate ensures accountability, compliance, and provides detailed history for troubleshooting and analysis.

Cross-Cutting Concepts

Flavor Profile System

The Flavor Profile System analyzes and categorizes flavors across the system:

  • FlavorProfile: Collection of taste characteristics
  • FlavorCharacteristic: Specific taste attribute (sweet, sour, bitter, etc.)
  • IngredientProfile: Flavor properties of specific ingredients
  • RecipeBalance: Analysis of a recipe's flavor components

This system helps in creating balanced menus and matching drinks to guest preferences.

Tagging System

The Tagging System provides organization and categorization:

  • Taggable: Interface for entities that can be tagged
  • Tag: Label applied to various entities for organization

Many entities implement the Taggable interface, allowing for flexible categorization and search.

Value Objects

The model uses several value objects to represent immutable concepts:

  • Theme: Defines the stylistic concept for an event
  • AttendanceEstimate: Projection of expected attendance
  • GuestPreference: Collection of a guest's preferences
  • RecipeBalance: Analysis of a recipe's flavor components
  • ProductBarcode: Identification code for a product
  • ProductData: Descriptive information about a product
  • ProductLevel: Current amount and status of a product
  • BatchIngredient: Scaled ingredient for batch preparation
  • FlavorCharacteristic: Specific taste attribute

Enumerations

The model includes several enumerations to represent fixed sets of values:

  • EventStatus: Status of an event (planned, in progress, completed, cancelled)
  • RSVPStatus: Status of a guest's RSVP (invited, confirmed, declined, maybe, no response)
  • DrinkCategory: Category of a drink (signature, classic, mocktail, etc.)
  • IngredientType: Type of ingredient (spirit, mixer, modifier, sweetener, garnish, other)
  • ProductType: Type of product (spirit, wine, beer, mixer, garnish, tool, equipment, glassware, other)
  • MeasurementUnit: Unit of measurement (oz, ml, cl, dash, tsp, tbsp, etc.)
  • GlassType: Type of glass (coupe, rocks, highball, collins, flute, etc.)
  • ToolType: Type of bar tool (shaker, strainer, jigger, spoon, muddler, etc.)
  • IceType: Type of ice (cube, sphere, crushed, cracked, block, etc.)
  • ShoppingListStatus: Status of a shopping list (draft, final, in progress, completed)
  • TagType: Type of tag (occasion, season, flavor, technique, difficulty, etc.)
  • NotificationType: Type of notification (info, warning, error, success, reminder, alert, system)

External Systems

The model interacts with several external systems:

  • ProductDatabase: External system for product data lookup
  • BarcodeScanner: External system for scanning product barcodes

Domain Model Implementation

The domain model provides a blueprint for implementation using domain-driven design principles:

  • Entities will be implemented as classes with identity and persistence
  • Value Objects will be implemented as immutable classes
  • Aggregates will enforce consistency boundaries and rules
  • Repositories will provide data access for aggregates
  • Services will implement operations that don't naturally belong to entities

Domain Model Implementation

The domain model provides a blueprint for implementation using domain-driven design principles:

  • Entities will be implemented as classes with identity and persistence
  • Value Objects will be implemented as immutable classes
  • Aggregates will enforce consistency boundaries and rules
  • Repositories will provide data access for aggregates
  • Services will implement operations that don't naturally belong to entities

This comprehensive domain model serves as the foundation for the Bartendie system, ensuring that the software accurately reflects the needs and workflows of home bartenders planning and executing cocktail events.

  • Context Map: See how these aggregates relate to bounded contexts
  • Event Storming: Understand the dynamic behavior of these entities
  • Command Flow: See how commands flow through these aggregates
  • Business Rules: Review the constraints and validation rules for these entities
  • Error Handling: Understand error patterns for domain operations

Ubiquitous Language

For a comprehensive glossary of terms used throughout the Bartendie system, refer to the Glossary document.