SlideShare a Scribd company logo
1 of 17
COMP23420 Semester 2 week 3:
      Domain to Design

   John Sargeant (johns@cs.man.ac.uk)


Please remember to switch off all electronic
         devices when in lectures.
John’s lectures

• Week 3: Domain to design
• Week 4: GRASP design principles (1) featuring
  coupling and cohesion
• Week 5: GRASP design principles (2) featuring
  inheritance
• Week 6: Testing concepts and approaches
• Week 7: Unit testing using JUnit
Overview

•   A note on terminology
•   Process sale example
•   Domain modelling - reminder
•   Design class notation
•   Domain to design
Terminology
• Structural modelling is modelling the static structure
  of something – in UML this is done mainly with class
  diagrams.

Two main kinds of structural models:
• Domain models aka domain class diagrams model
  domain classes, whose instances are real-world
  objects relevant to the system being built.
• Design models aka design class diagrams model
  design classes, aka system classes, whose
  instances are software objects in the system being
  built.
Key ideas
• Domain class diagrams show “real world” domain
  classes, not software classes, but…
• domain classes often inspire software classes
• But: the mapping is not 1-1 – some domain classes
  will not lead to design classes,
• You may discover more domain classes in the
  process of design….
• which means you may need to go back to the
  stakeholders to clarify requirements…
• which means you may need to revise the UCs etc.
Pure fabrication
A Pure fabrication is a design class which does not
  correspond to anything in the domain, e.g.
• Collections
• Interfaces to external systems, e.g. database
  connectors
• Factories – classes whose sole job is to create
  objects of other classes.
• UI components
• Indirections to, and abstractions of, other classes.
Over time, the PFs usually outnumber the domain-
  inspired classes.
Example: process sale, cash
    only, use case (brief format)
A customer brings a basket containing items to the
  cash desk. The cashier enters details of the items
  into the cash till using the barcodes on the items,
  and the cash till calculates the total amount due. The
  customer offers an amount of money at least as
  much as required, and the cash till indicates the
  amount of change required. The cashier gives the
  change and a receipt printed by the cash till to the
  customer.
The details of the transaction are recorded in a
  database.
Domain model
Guidelines
• Show relationships between classes, not details of
  classes (key attributes only)
• Keep it simple – don’t try to include everything (no
  “right answer”), e.g. I omitted cash desk and money.
• Try to make it as informative as possible
• Use stakeholder’s terminology - “mapmaker principle”
• Names and multiplicities of associations are
  important
• Note use of diamond for “contains”. You must use
  the notation correctly in the exam.
Multiplicities
• Are important – often generate questions to
  stakeholders
• Should be read both ways – a basket contains one or
  more items (or could be 0..*) and an item can’t be in
  more than one basket (or could be 0..1)
• Multiplicities model the situation at any one time – in
  this case for any one sale. For the duration of the
  sale there is a 1-1 relationship between customer,
  cashier, and cash till.
• See Larman ch9 For a more realistic version of this
  example.
Design class notation
• Types: UML standard is name:type, e.g.
  CashierID:String             but use Java-style
  String CashierID             if you prefer
• Operations: getName(CashierID: String): String
• Visibility: + (public) – (private) # (protected)
• Static things:
  loadFromFile(Filename: String): List<Cashier>


NB: Displaying types, visibilities etc. is optional – avoid
  premature design decisions.
Domain to design (1)
• Domain classes provide a useful starting point for
  design
• Most designs will need to be refined with GRASP
  principles (next 2 lectures) and design patterns
  (COMP33411)
• Since design classes are more detailed, we usually
  include less of them on one diagram.
• A whiteboard is good for discussing design choices
  and you can take pictures of it for documentation.
• Remember, being Agile means avoiding unnecessary
  ceremony and embracing change.
Domain to design (2)
• Which domain classes carry over depends on the
  application, e.g. Basket is needed for an online store
  but not a physical one.
• Human actors should be included in the design iff you
  need to store data about them (e.g. Cashier, not
  Customer).
• External software systems, databases etc. are not
  included. Instead, we typically have a Pure
  Fabrication such as a database connector.
• 1-many and many-many associations often lead to
  collections in the design
Cash till design
Points to note
• We’re modelling the software for a physical cash till.
• The diagram is still relatively simple – for
  comprehensive documentation, use javadoc.
• We have modelled the cashier logging in (not in the
  UC) because that’s the only reason for having the
  Cashier class.
• The Money domain class is clearly needed – that
  doesn’t mean the domain model was wrong.
• We also seem to need a Sale (or SaleDetails) class.
• We have added the PF database connector.
Questions raised
• (Scope) what other information do we need to store
  about a cashier, e.g. hours worked to calculate pay?
• (Functional requirement) – what does the
  calculateTotalPrice operation need do to (special
  offers, bogof etc)?
• (Non-functional requirement) do the sale details need
  to be recorded in the database once at the end, or
  incrementally as the sale goes on?
• (Implementation decision) should we have one
  database connector for all the tills, or one per till, or
  something in between?
Summary
• A domain model provides a good starting point for a
  design.
• Doman classes often inspire design classes, but it is
  definitely not a 1-1 mapping and it can even happen
  the other way round.
• Design classes are more detailed than domain
  classes, but it’s important not to clutter them.
• An initial design model is likely to generate questions
  about requirements, not just design decisions.
• Be Agile – avoid modelling for the sake of it.

More Related Content

Similar to Week3 to-design

1605162990-week56.pptx
1605162990-week56.pptx1605162990-week56.pptx
1605162990-week56.pptxSumbalIlyas1
 
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxclean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxsaber tabatabaee
 
Object Oriented System Design
Object Oriented System DesignObject Oriented System Design
Object Oriented System DesignMurugeswari Ravi
 
Object oriented analysis and design
Object oriented analysis and designObject oriented analysis and design
Object oriented analysis and designnaveed428
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPChris Renner
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introductionwojtek_s
 
Chap 6 - Software Architecture Part 1.ppt
Chap 6 - Software Architecture Part 1.pptChap 6 - Software Architecture Part 1.ppt
Chap 6 - Software Architecture Part 1.pptkhalidnawaz39
 
Chap 6 - Software Architecture Part 1.pptx
Chap 6 - Software Architecture Part 1.pptxChap 6 - Software Architecture Part 1.pptx
Chap 6 - Software Architecture Part 1.pptxssuser0ed5b4
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)stanbridge
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applicationspanagenda
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithmsiqbalphy1
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.pptNelsonYanes6
 

Similar to Week3 to-design (20)

Unit 2
Unit 2Unit 2
Unit 2
 
1605162990-week56.pptx
1605162990-week56.pptx1605162990-week56.pptx
1605162990-week56.pptx
 
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxclean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
 
SDWest2005Goetsch
SDWest2005GoetschSDWest2005Goetsch
SDWest2005Goetsch
 
5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt5-CEN6016-Chapter1.ppt
5-CEN6016-Chapter1.ppt
 
Object Oriented System Design
Object Oriented System DesignObject Oriented System Design
Object Oriented System Design
 
Object oriented analysis and design
Object oriented analysis and designObject oriented analysis and design
Object oriented analysis and design
 
CBD.pptx
CBD.pptxCBD.pptx
CBD.pptx
 
Vba Class Level 3
Vba Class Level 3Vba Class Level 3
Vba Class Level 3
 
An Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHPAn Introduction to Domain Driven Design in PHP
An Introduction to Domain Driven Design in PHP
 
Domain Driven Design Introduction
Domain Driven Design IntroductionDomain Driven Design Introduction
Domain Driven Design Introduction
 
Chap 6 - Software Architecture Part 1.ppt
Chap 6 - Software Architecture Part 1.pptChap 6 - Software Architecture Part 1.ppt
Chap 6 - Software Architecture Part 1.ppt
 
Chap 6 - Software Architecture Part 1.pptx
Chap 6 - Software Architecture Part 1.pptxChap 6 - Software Architecture Part 1.pptx
Chap 6 - Software Architecture Part 1.pptx
 
Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)Cs 1023 lec 10 uml (week 3)
Cs 1023 lec 10 uml (week 3)
 
uml.ppt
uml.pptuml.ppt
uml.ppt
 
Engage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino ApplicationsEngage 2020 - Best Practices for analyzing Domino Applications
Engage 2020 - Best Practices for analyzing Domino Applications
 
Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 
CEN6016-Chapter1.ppt
CEN6016-Chapter1.pptCEN6016-Chapter1.ppt
CEN6016-Chapter1.ppt
 
Design p atterns
Design p atternsDesign p atterns
Design p atterns
 

Recently uploaded

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Week3 to-design

  • 1. COMP23420 Semester 2 week 3: Domain to Design John Sargeant (johns@cs.man.ac.uk) Please remember to switch off all electronic devices when in lectures.
  • 2. John’s lectures • Week 3: Domain to design • Week 4: GRASP design principles (1) featuring coupling and cohesion • Week 5: GRASP design principles (2) featuring inheritance • Week 6: Testing concepts and approaches • Week 7: Unit testing using JUnit
  • 3. Overview • A note on terminology • Process sale example • Domain modelling - reminder • Design class notation • Domain to design
  • 4. Terminology • Structural modelling is modelling the static structure of something – in UML this is done mainly with class diagrams. Two main kinds of structural models: • Domain models aka domain class diagrams model domain classes, whose instances are real-world objects relevant to the system being built. • Design models aka design class diagrams model design classes, aka system classes, whose instances are software objects in the system being built.
  • 5. Key ideas • Domain class diagrams show “real world” domain classes, not software classes, but… • domain classes often inspire software classes • But: the mapping is not 1-1 – some domain classes will not lead to design classes, • You may discover more domain classes in the process of design…. • which means you may need to go back to the stakeholders to clarify requirements… • which means you may need to revise the UCs etc.
  • 6. Pure fabrication A Pure fabrication is a design class which does not correspond to anything in the domain, e.g. • Collections • Interfaces to external systems, e.g. database connectors • Factories – classes whose sole job is to create objects of other classes. • UI components • Indirections to, and abstractions of, other classes. Over time, the PFs usually outnumber the domain- inspired classes.
  • 7. Example: process sale, cash only, use case (brief format) A customer brings a basket containing items to the cash desk. The cashier enters details of the items into the cash till using the barcodes on the items, and the cash till calculates the total amount due. The customer offers an amount of money at least as much as required, and the cash till indicates the amount of change required. The cashier gives the change and a receipt printed by the cash till to the customer. The details of the transaction are recorded in a database.
  • 9. Guidelines • Show relationships between classes, not details of classes (key attributes only) • Keep it simple – don’t try to include everything (no “right answer”), e.g. I omitted cash desk and money. • Try to make it as informative as possible • Use stakeholder’s terminology - “mapmaker principle” • Names and multiplicities of associations are important • Note use of diamond for “contains”. You must use the notation correctly in the exam.
  • 10. Multiplicities • Are important – often generate questions to stakeholders • Should be read both ways – a basket contains one or more items (or could be 0..*) and an item can’t be in more than one basket (or could be 0..1) • Multiplicities model the situation at any one time – in this case for any one sale. For the duration of the sale there is a 1-1 relationship between customer, cashier, and cash till. • See Larman ch9 For a more realistic version of this example.
  • 11. Design class notation • Types: UML standard is name:type, e.g. CashierID:String but use Java-style String CashierID if you prefer • Operations: getName(CashierID: String): String • Visibility: + (public) – (private) # (protected) • Static things: loadFromFile(Filename: String): List<Cashier> NB: Displaying types, visibilities etc. is optional – avoid premature design decisions.
  • 12. Domain to design (1) • Domain classes provide a useful starting point for design • Most designs will need to be refined with GRASP principles (next 2 lectures) and design patterns (COMP33411) • Since design classes are more detailed, we usually include less of them on one diagram. • A whiteboard is good for discussing design choices and you can take pictures of it for documentation. • Remember, being Agile means avoiding unnecessary ceremony and embracing change.
  • 13. Domain to design (2) • Which domain classes carry over depends on the application, e.g. Basket is needed for an online store but not a physical one. • Human actors should be included in the design iff you need to store data about them (e.g. Cashier, not Customer). • External software systems, databases etc. are not included. Instead, we typically have a Pure Fabrication such as a database connector. • 1-many and many-many associations often lead to collections in the design
  • 15. Points to note • We’re modelling the software for a physical cash till. • The diagram is still relatively simple – for comprehensive documentation, use javadoc. • We have modelled the cashier logging in (not in the UC) because that’s the only reason for having the Cashier class. • The Money domain class is clearly needed – that doesn’t mean the domain model was wrong. • We also seem to need a Sale (or SaleDetails) class. • We have added the PF database connector.
  • 16. Questions raised • (Scope) what other information do we need to store about a cashier, e.g. hours worked to calculate pay? • (Functional requirement) – what does the calculateTotalPrice operation need do to (special offers, bogof etc)? • (Non-functional requirement) do the sale details need to be recorded in the database once at the end, or incrementally as the sale goes on? • (Implementation decision) should we have one database connector for all the tills, or one per till, or something in between?
  • 17. Summary • A domain model provides a good starting point for a design. • Doman classes often inspire design classes, but it is definitely not a 1-1 mapping and it can even happen the other way round. • Design classes are more detailed than domain classes, but it’s important not to clutter them. • An initial design model is likely to generate questions about requirements, not just design decisions. • Be Agile – avoid modelling for the sake of it.

Editor's Notes

  1. Title slide