[OOPP] L5 - Domain Analysis and Models
[OOPP] L5 - Domain Analysis and Models
and Models
Object-oriented
Programming Project
Niklas Broberg, 2024
PSA: Pitch Sessions
• Confirmed “issue” with GU students on Canvas and
“Appointment Groups”. Future bookings will be handled
via Slack.
• The GU-only teams will be contacted for a special invite
regarding these first sessions.
• Please lift any issues you may have: to me, to your supervisors,
and/or to your student representatives:
• GU: Yousef Noufal, Tim Persson, Daniell Cole
• Chalmers: Chloe Dusén, Thomas Mathiassen, Shifaa Mahmoud
• Design – How do we structure the software in the best way? Do The Thing Right
• Architecture (MVC), components , modules
• SOLID, design patterns Technical Conversation
• Independent of programming language, frameworks, etc. within the team, or
between development
teams
• Implementation – How do we realize our design in practice?
• Programming language, frameworks/libraries/APIs, … Make The Thing Work
• Concrete algorithms, data structures, method implementations, …
Smaller groups
User Feedback
• What do you test? Active choice!
• W1: UI mockups, project ideas
• After that, you choose. Priorities?
Single features (vertical slices)?
User experience?
SignalLogger SignalView
SignalApp + actOnSignalChange(SignalStatus) : void + actOnSignalChange(SignalStatus) : void
+ main(String[]) : void
Ubiquitous Language
• Ubiquitous (en): “överallt närvarande, genomsyrande,
förekommande”
• Build the pidgin language from the lingo that already exists in the
domain.
• Teaching domain experts about developer lingo is very very hard.
• However, some technical lingo is useful to introduce.
• Teaching developers about domain lingo is not trivial – but:
• Much easier than other way around.
• Added benefit of making developers analyse and understand the domain better.
RAD: Requirements Analysis Document
• Communicating “Domain Design” to domain experts, to facilitate
continuous Conversation.
• Includes
• Introduction – in plain text, what are the overarching goals and vision?
• “Requirements”:
• GUI sketch/mockups
• User Stories
• (Stages,) DoD: Definition of Done
• Domain model
Running example: Monopoly
• “The project aims to create a computer based generic version of the well known board
game Monopoly by Parker brothers. Generic in the sense that it's should be possible to
adapt the game to different locations and more.” – Introduction in RAD
• General characteristics:
• The application will be turn based.
• The actual player must explicitly end his or her turn.
• The next player is chosen by the application from a preset ordering.
• The ordering is generated randomly by the application at start of the
game.
• There are no time constraints for a round.
• The application will end according to the rules or possibly be cancelled.
• If the game is cancelled the player with most resources will be the winner.
• The application will handle all of the bank's responsibilities.
• …
UI
sketches/mockups
Epics As as: user
I want to: set up the game
so that: the game can commence
As a: user Acceptance:
I want to: play the Monopoly game - User can set the options
so that: I can have fun - After all options have been defined
(number of players etc.), the game is
Acceptance: ready to start
- User can play game according to Monopoly
rules
As as: player
I want to: take a turn
so that: I can try to win
Acceptance:
- User can roll dices
- User can make a move
- The state of the game is updated
according to Monopoly rules
- ...
User Stories As as: player
I want to: roll the dice
so that: I can make a move
Acceptance:
- Player can start the roll of the dices
As as: user - Only the active player can roll the dices
I want to: choose the number of players - After rolling the player can make a move
so that: I configure the game - The player can only roll the dices one time
- ...
Acceptance:
- Application can read input from user
- User can fill in number of players
- The game configuration is updated according to user input
- The game cannot start before the number players is configured
- The number of players can not be changed after the game has
started
- ....
Task breakdown
• Show the board
• Show the players on the board
As as: player
I want to: roll the dice • Highlight the active player
so that: I can make a move
• Allow the active player to roll the dice
Acceptance: • Show the resulting dice values
- Player can start the roll of the dices
- Only the active player can roll the dices • Make the dice values available to
- After rolling the player can make a move
- The player can only roll the dices one time other actions (next move)
- ...
• Change active player
Domain-Driven Design (DDD)
• Design methodology closely connected to “Agile”
development processes (XP)
• Built around the interplay between Domain Model and
User Stories
• Central aspect (Domain Pattern): Ubiquitous Language
• Concretized (internally by developer team) through a design model, including class and object
diagrams, …
Monopoly: Domain model
First iteration!
Domain model vs Class diagram
Weird multiplicities,
missing relationships, …
Aggregates
• Entities can often be composed of many aspects (components).
• Both on the domain level, and in the design model.
• Implementation: Should preferably be clonable (.clone, copy constructor) and compare based
on values (.equals instead of ==, since referential equality is meaningless)
Second iteration – entities – draft work-in-progress
Monopoly Board
Player
Represents the game and Knows the order of
Represented by a piece different spaces
its rules
Has money
Owns streets
Piece is no longer
an entity
Dice Space
Can be rolled by player Represents one space a
Result between 1 and 6 player can land on
Value Object,
not entity
Third iteration – relationships – draft still!
Monopoly Board
Player
Represents the game and Knows the order of
Represented by a piece different spaces
its rules
Has money
Owns streets
• Design – How do we structure the software in the best way? Do The Thing Right
• Architecture (MVC), components , modules
• SOLID, design patterns Technical Conversation
• Independent of programming language, frameworks, etc. within the team, or
between development
teams
• Implementation – How do we realize our design in practice?
• Programming language, frameworks/libraries/APIs, … Make The Thing Work
• Concrete algorithms, data structures, method implementations, …
Smaller groups
Seminar: requirements
• We want you to present:
• A (early draft of) domain model
• Some examples of user stories.
• GUI mockups, screenshots, …
• If you have a demo, fabulous!