DOC PREVIEW
UT Dallas CS 6359 - S7_Chapters9-31_1

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Slide 1What will we learn?Using UML to Diagram Domain ModelsMore on MultiplicityMultiple AssociationsRecall: Initial Draft of Domain Model for POSSlide 7Recall: Initial Draft of Domain Model for MonopolySlide 9Domain Models: Adding AttributesDomain Models: Adding AttributesDerived Attribute: ExampleAttributes Versus ClassesData Type ClassesData Type Class: ExampleGuidelines for Creating Data Type ClassNo Foreign KeysModeling QuantitiesSlide 19Attributes: POS ExampleSlide 21Attributes: Monopoly ExampleSlide 23Domain Modeling in UPDomain Model RefinementDomain Model Refinement: GeneralizationDomain Model Refinement: GeneralizationSlide 28Takeaways from Chapters 9 and 31Next …Object-Oriented Analysis and DesignCHAPTERS 9, 31: DOMAIN MODELS1What will we learn?Domain Model – how to create itRefining the Domain Model2Using UML to Diagram Domain ModelsWe’ve seen that once the conceptual classes in the Domain Model are identified, we can add associations between themAssociations imply some type of “memory” of informationAssociations are usually named with a verb, in the ClassName-VerbPhrase-ClassName formatEach end of an association is called a role, and roles may have a multiplicity expression, a name, and navigabilityMultiplicity is notated in the UML diagram, and indicates how many instances of a class can be associated with one instance of the another classThis is referring to a moment in time, not over a time intervalExample: A person is married to only one person at a time, but may be married to many people over their lifetime3More on Multiplicity Recall the UML notation we mentioned earlier … Always carefully consider the 1 versus 0..1 question – is there always at least one instance?4ItemStoreStocks*multiplicity of the role1Multiple AssociationsIt is possible to have multiple associations between classesThe book lists the Common Associations List, a good starting point5Flight AirportFlies-toFlies-from**11Recall: Initial Draft of Domain Model for POS6StoreRegister SaleItemCashPaymentSalesLineItemCashier CustomerProductCatalogProductDescriptionLedgerNextGen POS – Domain Model with associations7RegisterItemStoreSaleCashPaymentSalesLineItemCashierCustomerProductCatalogProductDescriptionStocks*Houses1..*Used-by*Contains1..*Describes*Captured-onContained-in1..*Records-sale-of 0..1Paid-byIs-forLogs-completed* Works-on11111..*11111110..1 11LedgerRecords-accounts-for11Recall: Initial Draft of Domain Model for Monopoly8Monopoly Game – Domain Model with associations9Domain Models: Adding AttributesUseful to add attributes to conceptual classes to satisfy an information requirement in a scenario. Note that in this case the attribute is a logical data value of an objectAttributes are added to the bottom of the conceptual class boxNotation: visibility name : type multiplicity = default value {property-string}10Sale- dateTime : Date- / total : MoneyPrivate visibility attributesMath+ pi : Real = 3.14 {readOnly}Public visibility readonly attribute with initializationPersonfirstNamemiddleName : [0..1]lastNameOptional valueDomain Models: Adding AttributesUsually assume that the attribute is private, unless otherwise notedBe careful about placing attribute requirements in the Domain ModelThe Domain Model is generally used as a tool to understand the system under development, and often any requirements that are captured there may be overlookedBest to capture attribute requirements in a GlossaryCan also use UML tools that can integrate a data dictionaryNote in the previous example we use the symbol “/” to indicate that an attribute is derived, i.e. computed. 11Derived Attribute: ExampleIn this case, multiple instances of an item can be added to a SaleLineItem one at a time or as a group. The quantity attribute can be computed directly from the multiplicity of the Items:12SalesLineItem ItemRecords-sale-of 10..1SalesLineItem ItemRecords-sale-of 0..11..*Each line item records a separate item sale.For example, 1 tofu package.Each line item can record a group of the same kind of items.For example, 6 tofu packages.SalesLineItem/quantityItemRecords-sale-of 0..11..*derived attribute from the multiplicity valueAttributes Versus Classes Often attributes are primitive data typesBoolean, Date, Number, Char, String, Time, …Do not make a complex domain concept an attribute – this should be a separate class. Data types are things which can be compared by value; conceptual classes are usually compared by identity Person class versus name string13FlightFlightdestinationWorseBetterFlies-toAirport1 1destination is a complex conceptData Type ClassesIt is also possible to have more complex data types as attributes in the Domain Model, and these are often modeled as classesFor example, in the NextGen POS example, we may have an itemID for each item; it is probably contained in the Item or ProductDescription classes. It could be a number or a string, but it may have more parts tooIn general, your analysis of the system will tell if the attributes are simple or need more complexity For example, upon examining the detail of the itemID, we may discover that it is made up of multiple parts, including a unique UPC, a manufacturer ID, a country code, etc. This would be a good candidate for a separate class14Data Type Class: Example In the bottom example, itemID and address would need to be described in the Glossary or someplace else in the Domain Model15OKOKProductDescriptionProductDescriptionitemId : ItemID1StoreStoreaddress : Address11 1ItemIDidmanufacturerCodecountryCodeAddressstreet1street2cityName...Guidelines for Creating Data Type ClassIf the data type is composed of multiple sections, like name, phone number, etc.There are operations associated with the data type, like parsingThere are other attributes that are associated with itA promotionalPrice may have a startDate and an endDate.It represents a quantity with a unit, e.g. currencyIt is an abstraction with one or more types of the aboveDo not use a “foreign key” to associate two classes – use UML associations, not attributesA simple attribute that is used to relate two classes – see next slide for an exampleBe careful with quantities that require units – best to do a separate classes. Examples are Money and Weight16No Foreign Keys17CashiernamecurrentRegisterNumberCashiernameRegisternumberWorks-onWorseBettera "simple" attribute, but being used as a foreign key to relate to another object11Modeling Quantities18Paymentamount :


View Full Document

UT Dallas CS 6359 - S7_Chapters9-31_1

Documents in this Course
Lecture2

Lecture2

63 pages

Lecture3

Lecture3

49 pages

Lecture4

Lecture4

48 pages

Lecture5

Lecture5

47 pages

Lecture6

Lecture6

45 pages

Lecture7

Lecture7

63 pages

Lecture8

Lecture8

77 pages

Lecture9

Lecture9

48 pages

Lecture10

Lecture10

84 pages

Lecture11

Lecture11

45 pages

Lecture12

Lecture12

134 pages

Lecture13

Lecture13

62 pages

Lecture14

Lecture14

76 pages

Project

Project

2 pages

Chapter_1

Chapter_1

25 pages

Load more
Download S7_Chapters9-31_1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view S7_Chapters9-31_1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view S7_Chapters9-31_1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?