OOAD - Ch 03_Developing Class Diagrams

29
Developing Class Diagrams

description

Developing Class Diagrams

Transcript of OOAD - Ch 03_Developing Class Diagrams

  • Developing Class Diagrams

  • Approaches for developing class diagrams Developing a class diagram from noun phrasesDeveloping a class diagram from using abstractionDeveloping a class diagram from use cases

  • Problem definition Developing a Library Checkout System

  • Isolating the noun phrasesYou, code, checkout duties, library, library member, book, video, system, memberItem number, clerk, book status, video status, title, authorLibrary card, membership number, borrower, borrower book, borrower video, overdue book, overdue video, loan condition, due date

  • Elimination criteriaA candidate class is redundantA candidate class is irrelevantThe candidate class is vagueThe candidate class is an attributeThe candidate class is an operationThe candidate class describes a roleThe candidate class represents an implementation construct

  • Applying criteriaRedundant classes: System, MemberIrrelevant classes: You, Code, Library CardClasses represents attributes: Item Number, Book Status, Video Status, Title, Author, Membership Number, Due DateOperation class: Checkout DutiesClasses describe roles: Borrower, Borrower Book and Borrower Video, Overdue Book and Overdue VideoIn such a way, after applying elimination criteria, remaining classes will come in class diagram. Several attributes will also been identified during this process.

  • An initial class diagram for library system

  • 2) Developing a class diagram using abstraction

  • 2) Developing a class diagram from using abstractionDomain experts uses this approach.Several methods adopt this techniques:In Object-oriented Analysis (Coad and yourdon )In Object-oriented System Analysis (Shlaer and Mellor method)In Object oriented Development: the Fusion method (coleman)

  • a) recommend set by Coad and yourdonIn Object-oriented Analysis Coad and yourdon recommend the following set:Are there are any kind-of or part-of relationship?With what other system will this system interact?With what devices will this system interact?What things or events must be remembered?What roles are played?What operational procedures exists in the system?What physical sites or organizational units exits?

  • b) Shlaer and Mellor methodIn Object-oriented System Analysis, Shlaer and Mellor offer a much shorter list of identification keys.What tangible things exits?What roles are played?What events must be remembered?What interaction must be carried out?

  • c) Fusion method In Object oriented Development, coleman recommend the following keys:What physical object exits?What people and organization involved?What abstraction are there?

  • E. g. of Developing a stock-Trading System cont...

  • E. g. of Developing a stock-Trading System cont...Following are abstraction from Shlaer and Mellor methods:Tangible things: Account, Order, stockRoles: Customer, Service representativeEvents: Stock Transfer, Cash TransferInteractions: Match (of orders)Next, need to consider each abstraction whether it is a class and, if so, what attributes and association it has.

  • E. g. of Developing a stock-Trading System cont...Considering Account-it's state information is as follows:An account numberA cash portfolioA stock portfolioA customer

  • E. g. of Developing a stock-Trading System cont...Figure : Accounts, Stock holdings, and customer

  • E. g. of Developing a stock-Trading System cont...Considering Order-it's state information is as follows:An order numberA typeA statusA stock nameA number of sharesA requested prize An optional expiration timeA reference to account

  • E. g. of Developing a stock-Trading System cont...Figure : The Order class

  • E. g. of Developing a stock-Trading System cont...Considering Service Representative

  • E. g. of Developing a stock-Trading System cont...Considering abstraction stock and match

  • E. g. of Developing a stock-Trading System cont...

  • 3) Developing a class diagram from use cases

  • 3) Developing a class diagram from use casesDetermining the system use cases and actors

    Developing a use case and class diagramsIncrease the clarity of use case diagram by including directions.Now develop class diagram from use cases. To accomplish this, step through each use case, adding enough to class diagram

  • 3) Developing a class diagram from use casesDetermining the system use cases and actors and draw use case diagram.

    Developing a use case diagram and class diagramsIncrease the clarity of use case diagram by including directions.Now develop class diagram from use cases. To accomplish this, Describe each use case first by writing paragrapg or stepwise description or activity diagram or pre-condition, post condition, triggers. Nowstep through each use case, adding enough to class diagram (enhance your class diagram by describing further use cases)

  • 3) Developing a class diagram from use cases cont

  • 3) Developing a class diagram from use cases cont... To develop a class diagram from use cases. To accomplish this, step through each use case, adding enough to class diagram

    Describe Place order use caseThe customer places a order for one or more catalog itemsThe order is entered in the system after it is fundedEach order item is allocated from available inventory

  • Class diagram for order processing

  • Comparing, Combining Approaches and Enhancing Benefits and drawbacks of above three phrasesCombining the three approachesEnhancing a model with specification.