6-20101011-1 - Introduction to OO Program Design Software...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to OO Program Design Software College of SCU Instructor: Shu Li Email: [email protected]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Unit 1.2 Designing Classes 1.2.5 Modeling Classes 1.2.6 Modeling the Library System
Background image of page 2
3 Modeling Classes 1. Identify classes of objects from the system specification. 2. Identify relationships between classes. 3. Identify attributes of each class. 4. Identify methods of each class. 5. Model system using UML.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Identify Classes and Objects An easy way to identify classes is to analyze the textual description in the system specification . In textual analysis, the nouns and the noun phrases often indicate objects and their classes. Singular nouns ("book," "library catalog," and "client") and plural nouns ("users," "books," and "accounts") indicate classes. Proper nouns ("the ACME Bank") and nouns of direct reference ("the person that owned the account") indicate objects.
Background image of page 4
5 Example In banking system, a client is a person that has one or more accounts. John Smith has a checking account in CITI bank.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 Steps for Identify Classes (1) List all the nouns in the specification. Prune the list: Convert plural nouns to their singular form. In an object model, class names are singular. Eliminate nouns that represent objects. Replace them with generic nouns. For example, use "client" instead of "John Smith." Eliminate vague nouns. Eliminate nouns that are class attributes. Group the synonyms and then choose the best name for the class from the group. For example, "user" and "client" are synonyms. In a bank system, the best name is "client" because the system may have two types of users: the clients and the bank's employees.
Background image of page 6
7 Steps for Identify Classes (2) Select the classes that are relevant to the system. Look for more relevant classes. Physical things. For example, "person," "book," and "computer." Roles played by persons or organizations. For example, "employer" and "supplier." Objects that represents an occurrence or event. For example, "system crash," "flight," and "mouse click." Objects that represent a relationship between other objects in the model. For example, "purchase" (related to "buyer," "seller," and "merchandise") and "marriage" (related to "man" and "woman").
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Steps for Identify Classes (3) People who carry out some function. For example, "student" and "clerk." Places. For example, "library," "classroom," and "bank." Collections of objects, people, resources, or facilities. For example,
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/12/2011 for the course ECON 101 taught by Professor Professor during the Spring '10 term at Cisco Junior College.

Page1 / 37

6-20101011-1 - Introduction to OO Program Design Software...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online