domain model refinements and more iteration 3 prep. · domain model refinements and more iteration...

15
Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974 Cell (937) 657-3885 Email: [email protected]

Upload: others

Post on 02-Aug-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Domain Model Refinements

and more Iteration 3 Prep. CSSE 574: Session 6, Part 2

Steve Chenoweth

Phone: Office (812) 877-8974

Cell (937) 657-3885 Email:

[email protected]

Page 2: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Recall: Techniques for identifying

conceptual classes

Conceptual category lists

Noun phrase identification

Existing domain models

Page 3: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Conceptual Category List on NextGen

POS, Iteration 3

Category Examples

physical or tangible objects CreditCard, Check

transactions

CashPayment,

CreditPayment,

CheckPayment

other systems external to

ours

CreditAuthorizationService,

CheckAuthorizationService

organizations CreditAuthorizationService,

CheckAuthorizationService

records of finance, work,

contracts, legal matters AccountsReceivable

Page 4: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Noun Phrase Identification on NextGen

POS, iteration 3

Credit Account

Information

Payment

Authorization

Request

Payment

Authorization

Service Payment

Approval

Page 5: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Generalization-Specialization

Class Hierarchy

Conceptual classes, not

software classes

Domain modeling!

Generalization: finding

commonalities among

concepts

Superclass: general

concept

Subclass: specialized

concept

Why? Can understand concepts

in more general terms.

Payment gives our brains less

to deal with.

Page 6: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Generalization

Common features

of Payments

Page 7: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Genaralizations and Sets

All members of a conceptual

subclass set are members of their

superclass set – but may not

―partition‖ the set…

Is-a rule: Subclass is a superclass,

e.g., CashPayment is a Payment

Page 8: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Subclass Conformance—The 100% Rule

The subclass must conform to all of the

superclass’s attributes and associations.

Page 9: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

As in, follow the Liskov Substitution

Principle!

"If for each object o1 of type S there is an

object o2 of type T such that for all

programs P defined in terms of T, the

behaviour of P is unchanged when o1 is

substituted for o2 then S is a subtype of T."

9

Quoted from http://www.blackwasp.co.uk/LSP.aspx.

Image of Barbara Liskov from

http://web.mit.edu/newsoffice/2009/turing-liskov-0310.html.

Page 10: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

When should we define

a Conceptual Subclass?

Does this make sense…

for NextGen POS?

for other domains?

Page 11: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

When should we define

a Conceptual Subclass? (continued)

When the subclass…

has additional attributes

has additional

associations

is operated on or

handled differently

represents an animated

thing that behaves

differently

Which of these

apply here?

Q3

Page 12: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

When should we group classes and

extract a superclass?

Create a superclass when:

1. Potential subclasses represent variations of a

similar concept

(e.g., Video, Game → RentableItem)

2. Subclasses will conform to 100% and is-a rules

3. There are common attributes or associations

that could be pulled into superclass

Page 13: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Another Example

Page 14: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Abstract Conceptual Classes

If every member of a class C must be a

member of a subclass, then C is an abstract

conceptual class

What does this mean in

terms of our set idea?

Italics (or {abstract} keyword)

indicate abstract class

Page 15: Domain Model Refinements and more Iteration 3 Prep. · Domain Model Refinements and more Iteration 3 Prep. CSSE 574: Session 6, Part 2 Steve Chenoweth Phone: Office (812) 877-8974

Be an Ontologist – go nuts on this!

15

Ontology = Basic categories of being

and their relations. Like these…