Object Oriented Analysis - Example: Asfar K

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Object Oriented Analysis - Example

Asfar K
User Story: Practice
Flower seller needs a software for billing.
Currently have different colors of Roses only
Each color of rose has different price
Need to reduce items sold from inventory
after each sale.
Bargaining is allowed for bulk buyers.
In case of bargain, he needs to ensure
minimum profit of 10% from each sale.

2
Domain Modeling
Find the conceptual classes
Read the requirement spec/user story
Draw UML class diagram
Find associations and attributes

3
User
Story
for Sale

4
5
Domain Classes
A domain model, is a visualization of things in
the real-world domain, not of software
components such as a Java or C++.
Not suitable in a domain model:
Software artifacts, such as a window or a
database, unless the domain being modeled is of
software concepts, such as a model of graphical
user interfaces.
Responsibilities or methods.

6
Finding Conceptual Classes with Noun
Phrase Identification
Main Success Scenario (or Basic Flow):
1. Customer arrives at a POS checkout with goods
and/or services to purchase.
2. Cashier starts a new sale.
3. Cashier enters item identifier.
4. System records sale line item and presents item
description, price, and running total.
Price calculated from a set of price rules.
Cashier repeats steps 2-3 until indicates done.

7
5. System presents total with taxes calculated.
6. Cashier tells Customer the total, and asks for
payment.
7. Customer pays and System handles payment.
8. System logs the completed sale and sends sale
and payment information to the
external Accounting (for accounting and
commissions) and Inventory systems (to update
inventory).
9. System presents receipt.
10.Customer leaves with receipt and goods (if
any).

8
Extensions (or Alternative Flows):

7a. Paying by cash:


1. Cashier enters the cash amount tendered.
2. System presents the balance due, and
releases the cash drawer.
3. Cashier deposits cash tendered and returns
balance in cash to Customer.
4. System records the cash payment

9
Conceptual Classes
Some of these noun phrases are candidate
conceptual classes
Some may refer to conceptual classes that are
ignored in this iteration (for example,
"Accounting and "commissions"),
Some may be attributes of conceptual classes.

10
Conceptual classes
Register -- POS
Item -- product-Item
Store -- Inventory
Sale
Payment
ProductCatalog
ProductSpecification
SalesLineItem
Cashier
Customer
Manager --added

11
Attribute or Class
Most common mistake is to represent
something as an attribute when it should have
been a concept.
If we do not think of some conceptual class X
as a number or text in the real world, X is
probably a conceptual class, not an attribute.
If in doubt, make it a separate concept.
Attributes should be fairly rare in a domain
model.
12
Specification or Description
Conceptual Classes

13
14
Association

15
Association - Guidelines
Focus on those associations for which knowledge
of the relationship needs to be preserved for
some duration ("need-to-know" associations).
It is more important to identify conceptual classes
than to identify associations.
Too many associations tend to confuse a domain
model rather than illuminate it. Their discovery
can be time-consuming, with marginal benefit.
Avoid showing redundant or derivable
associations.
16
Class diagram - partial

17
18
Adding Attributes
An attribute is a logical data value of an object.
The requirements suggest or imply a need to
remember information.
For example
a receipt normally includes
a date and time
management wants to know the dates and times of
sales for a variety of reasons
the Sale conceptual class needs a date and time attribute.

19
Simple attributes or data types.
Very common attribute data types include:
Boolean, Date, Number, String (Text), Time
Other types include:
Address, Color, Geometries (Point, Rectangle),
Phone Number, Social Security Number, Universal
Product Code (UPC), SKU, ZIP or postal codes,
enumerated types

20
Example

21
Modeling Attribute Quantities and
Units

22
Internationalization

23
Attributes

24
25
User Story: Practice
Flower seller needs a software for billing.
Currently have different colors of Roses only
Each color of rose has different price
Need to reduce items sold from inventory
after each sale.
Bargaining is allowed for bulk buyers.
In case of bargain, he needs to ensure
minimum profit of 10% from each sale.

26
Thank You

27

You might also like