Presentation is loading. Please wait.

Presentation is loading. Please wait.

Class Diagram Mehwish Shafiq. Class Collection of object that share common properties, attributes, and behavior. Collection of objects with same data.

Similar presentations


Presentation on theme: "Class Diagram Mehwish Shafiq. Class Collection of object that share common properties, attributes, and behavior. Collection of objects with same data."— Presentation transcript:

1 Class Diagram Mehwish Shafiq

2 Class Collection of object that share common properties, attributes, and behavior. Collection of objects with same data structures (attributes) and behavior (Function, code, operation).

3 Classification & Instantiation Grouping common objects in a class is classification. Instantiation is the Act of creating an instance.

4 Example

5 Representing a class Class Name Attributes Methods

6 Members of a Class Attributes and Methods Their Visibility has 3 types  Public “+”  Private “-”  Protected “#”

7 Example-Visibility Student - enrolment_no : String - award : String + set_number(number ): int + set_award(award) + get_number() + get_award()

8 Interface We access objects by calling its methods. Set of method calls available for object are called its interface. Student - enrolment_no : String - award : String + set_number(String n ) + set_award(String a ) + get_number( ) + get_award( )

9 More about Classes Define classes that collaborate to perform required task. Define classes that deliver required use cases. Defining classes=defining overall system architecture.

10 Identifying Classes identify the important things mentioned in the text usually described as ‘things of interest in the system’ ‘things of interest’ = things = nouns normally nouns and noun phrases Noun identification process:  underline all nouns and noun phrases  gives a first rough list  refine/analyse/eliminate rough list to produce candidate class list

11 Refining First Noun List convert plurals to singular  Books > Book remove synonyms  choose one of ‘library-member’ & ‘member of the library’ remove anything vague/ambiguous, or clarify it usually remove events or actions remove anything outside the scope of the system gives list of possible classes

12 Refining Candidate Class List check relevance/role/need for the class  would Publisher be a class, or just an attribute of Book

13 Dealing with Uncertainty? if in doubt  keep it in the list?  or not? keeping it in may cause confusion/ambiguity leaving it out may lose information some analysts keep 2 lists  definites and maybes

14 What kind of things might be classes? real-world tangible things - Book, Copy real-world intangibles - Course, Unit roles - Borrower, Student sometimes (but often not)-> events, interactions  loan, appointment

15 Actors and classes is an actor a class in the system? Yes, if  system needs to store information about the actor, for example BookBorrower becomes Library_member


Download ppt "Class Diagram Mehwish Shafiq. Class Collection of object that share common properties, attributes, and behavior. Collection of objects with same data."

Similar presentations


Ads by Google