Presentation is loading. Please wait.

Presentation is loading. Please wait.

Feb 18, 200291.3913 R McFadyen1 Feb 18, 2002 Review of some modeling concepts Introduction of Moment-Interval.

Similar presentations


Presentation on theme: "Feb 18, 200291.3913 R McFadyen1 Feb 18, 2002 Review of some modeling concepts Introduction of Moment-Interval."— Presentation transcript:

1 Feb 18, 200291.3913 R McFadyen1 Feb 18, 2002 Review of some modeling concepts Introduction of Moment-Interval

2 Feb 18, 200291.3913 R McFadyen2 Association Classes (Pages 411-414) In a typical university: We have an Course class and a Student class. A Student enrolls in an Course and is eventually assigned a grade. A Student may enroll in several Courses. A Course will have many Students enrolled. Consider : StudentCourse ** Where is the student’s grade kept? We can’t keep it with Student … nor with Course

3 Feb 18, 200291.3913 R McFadyen3 Association Classes StudentCourse ** Grade is considered an attribute that belongs to the association between a student and a course. If your model has a many-to-many association between two classes, then there will likely be a need for an association class Enrollment grade courseNum

4 Feb 18, 200291.3913 R McFadyen4 Association Classes StudentCourse ** Enrollment grade 2914 3913 123 333 789 Suppose we have 3 students taking one or two courses : courseNum studNum

5 Feb 18, 200291.3913 R McFadyen5 Association Classes StudentCourse ** Now suppose we need to track these grades over several terms we need to know what grades a student received for a course that was repeated more than once. The above model doesn’t accommodate this - there are different approaches Enrollment grade courseNum studNum

6 Feb 18, 200291.3913 R McFadyen6 Association Classes StudentCourse ** Associate a collection of Offerings with a course - each offering is associated with a particular time interval (in this case the time interval is duration of the term) Section 27.3 refers to a Moment-Interval archetype - a concept promoted by Peter Coad. The idea recognizes that some things that we need to track, either occur at a moment in time, or, they occur over an interval of time. Enrollment grade Offering courseNum term instructor studNum *

7 Feb 18, 200291.3913 R McFadyen7 Moment-Interval archetype Coad would indicate these types of classes with the designation: >, and, they would be coloured: > Offering term instructor > Offering term instructor Colour makes these kinds of classes stand out in a diagram. Supposed to be pink

8 Feb 18, 200291.3913 R McFadyen8 Association Class Student Offering ** Enrollment grade term instructor studNum 11 Wouldn’t this work too? (and there’s no association class) What’s different? This permits the same course and the same student to be related several times Enrollment is promoted to a full-fledged class There are two associations now, instead of one

9 Feb 18, 200291.3913 R McFadyen9 Peter Coad & Moment-Interval > Student > Course * * > Enrollment grade courseNum studNum > Offering term courseNum instructor *

10 Feb 18, 200291.3913 R McFadyen10 Peter Coad & Four Archetypes > PartyRole A role is a way of participation by a person, place, or thing. Instead of Person, Coad uses Party since it captures both person and organization. A Cashier accepts the payment An Instructor gives a mark A clerk processes the registration > ThingRole > PlaceRole

11 Feb 18, 200291.3913 R McFadyen11 Peter Coad & Four Archetypes > PartyDescription A Description is a catalogue- entry-like description. It is a collection of values that apply again and again. > ThingDescription > PlaceDescription

12 Feb 18, 200291.3913 R McFadyen12 Peter Coad & Four Archetypes > Party A Party, Place, or Thing is someone or something that plays different roles. A person might be both an employee and a customer. A Place might be both a retail outlet and a wholesale outlet. A Thing might play one role in a manufacturing process and a different role in a purchasing process > Thing > Place

13 Feb 18, 200291.3913 R McFadyen13 Peter Coad & Four Archetypes > MomentInterval Something one works with and tracks for business or legal reasons, Something that occurs at a moment in time, or over an interval of time A sale is made at a moment in time A rental happens over an interval of time A reservation occurs over an interval of time

14 Feb 18, 200291.3913 R McFadyen14 Peter Coad & Four Archetypes > PartyDescription > PlaceDescription > ThingDescription > PlaceRole > Place > PartyRole > Party > MomentInterval number date total... makeMomentInterval addDetail calcTotal... > ThingRole > Thing Coad calls this pattern the Domain Neutral Component

15 Feb 18, 200291.3913 R McFadyen15 Peter Coad & Four Archetypes > ProductDescription > BusinessLocation > Customer Not all components must be there > Cashier > Payment > CashSale > CashSaleDetail * * * * * *

16 Feb 18, 200291.3913 R McFadyen16 From the text A SalesLineItem is related to a ProductSpecification which is associated with a collection of ProductPrice Which class is the Moment-Interval?

17 Feb 18, 200291.3913 R McFadyen17 Reflexive Associations (section 27.8) child parent Would an association class be of any use here?

18 Feb 18, 200291.3913 R McFadyen18 Reflexive Associations Would an association class be of any use here? marries husband wife **


Download ppt "Feb 18, 200291.3913 R McFadyen1 Feb 18, 2002 Review of some modeling concepts Introduction of Moment-Interval."

Similar presentations


Ads by Google