Domain Model
The domain model represents the key entities, value objects, aggregates, and their relationships in the Bartendie 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
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.
Menu Aggregate
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.
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.)
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
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.