Presentation is loading. Please wait.

Presentation is loading. Please wait.

MODULE:VII OBJECT ANALYSIS: CLASSIFICATION

Similar presentations


Presentation on theme: "MODULE:VII OBJECT ANALYSIS: CLASSIFICATION"— Presentation transcript:

1 MODULE:VII OBJECT ANALYSIS: CLASSIFICATION
4/26/2017 Module VII Object Analysis:Classification

2 Module VII Object Analysis:Classification
Recap: Objects Objects are taken from the real world They are abstract entities encapsulating data AND associated behaviour Data is “protected” within individual chunks .Data Hiding. Objects communicate (interfaces and messages) “Design by contract” objects make up the services offered by the system eg: departments in an organisation Objects are grouped into classes Inherit from super class. 4/26/2017 Module VII Object Analysis:Classification

3 The Use Case Driven Approach
4/26/2017 Module VII Object Analysis:Classification

4 Classifications Theory
The process of checking to see if an object belongs to a category or a class, is regarded as a basic attribute of human nature. Booch Explains: Intelligence classification is part of all good science…Classification guides us in making decision about modularization. 4/26/2017 Module VII Object Analysis:Classification

5 Classifications Theory…
We may choose to place certain classes and objects together in the same module or in different modules, depending upon the sameness we find among these declarations; Coupling and cohesion are measures of this sameness. Coupling also plays a role in allocating processes to procedures. We place certain processes together in the same processor or different processors, depending upon packaging, performance, or reliability concern. 4/26/2017 Module VII Object Analysis:Classification

6 Classifications Theory…
Classes are important mechanism for classifying objects. Eg: new car launched. The chief role of a class is to define the attributes, methods and applicability of instances. Classification is concerned more with identifying the class of an object than the individual objects within a system.—attributes. 4/26/2017 Module VII Object Analysis:Classification

7 Module VII Object Analysis:Classification
Finding Classes Finding classes is not easy. The more practice you have, the better you get at identifying classes. Finding classes is an incremental and iterative process. 4/26/2017 Module VII Object Analysis:Classification

8 There is no such thing as the “right set of classes”
4/26/2017 Module VII Object Analysis:Classification

9 Module VII Object Analysis:Classification
Finding Classes… Unless you are starting with a lot of domain knowledge, you are probably missing more classes than you will eliminate. Naming a class is also an important activity The class should describe a single object, so it should be a singular noun or an adjective and a noun 4/26/2017 Module VII Object Analysis:Classification

10 Finding Classes: User Involvement…
Make an adequate commitment of time. Iterative-still complete within time. Have good warning of the time commitment that will be required of them Be high-caliber workers who know their field or profession thoroughly Be chosen from a variety of levels 4/26/2017 Module VII Object Analysis:Classification

11 Module VII Object Analysis:Classification
Finding Classes… Jacobson’s 3 types Entity Concrete—land,place Conceptual—not tangible Event and State Interface Control 4/26/2017 Module VII Object Analysis:Classification

12 Guidelines For Identifying Classes
The followings are guidelines for selecting classes in your application: Look for nouns and noun phrases in the problem statement Some classes are implicit or taken from general knowledge Eg:-HR management system 4/26/2017 Module VII Object Analysis:Classification

13 Approaches for Identifying Classes…
Noun Phrase Approach Common Class Pattern Approach CRC(Classes, Relation, Collaboration) Approach Use-Case Driven Approach--The unified approach uses the use-case driven approach for identifying classes and understanding behaviour of objects. 4/26/2017 Module VII Object Analysis:Classification

14 Module VII Object Analysis:Classification
Noun Phrase Approach Using Noun Phrase method, you have to read through the use cases or requirements. One way of gathering requirements is through interviews. Change all plurals to singular and make a list, which can then be divided into three categories 4/26/2017 Module VII Object Analysis:Classification

15 Module VII Object Analysis:Classification
Noun Phrase Approach 4/26/2017 Module VII Object Analysis:Classification

16 Noun Phrase Approach… Irrelevant classes are simply scraped off.
You must be able to formulate a statement of purpose for each candidate class; if not, simply eliminate it. Flexibility is a virtue. Flexible bcoz it is an incremental and iterative approach. Redundant classes-part of common vocabulary. if mre than one word is being used to describe the same idea select the one that is most meaningful in context of the system. 4/26/2017 Module VII Object Analysis:Classification

17 Module VII Object Analysis:Classification
Noun Phrase Approach… Adjective Classes Does the object represented by the noun behave differently when the adjective is applied to it ? If use of adjective signals that behaviour of class is different then make a new class. “Current Account Holder” “Savings Account holder” Attribute Classes Tentative objects used only as values should be defined or restated as attributes and not as a class. Eg:- Client status. 4/26/2017 Module VII Object Analysis:Classification

18 Guidelines For Refining Classes
Redundant Classes: Do not keep two classes that express the same information. If more than one word is being used to describe the same idea, select the one that is the most meaningful in the context of the system. Remember by FRIAR 4/26/2017 Module VII Object Analysis:Classification

19 Common Class Patterns Approach…
Based on knowledge base of common classes that have been proposed by various researchers. Events Class An order, landing etc. Organisation Class Finance Department , HR Department. People Class—those representing user of system and about whom info is kept in the system. Eg-HR manager of a company is user of the employee management system and being an employee is also a part of the employee management system. 4/26/2017 Module VII Object Analysis:Classification

20 Common Class Patterns Approach
Places-physical locations that system must keep info abt. Offices, buildings Tangible things and devices with which application interacts Cars-tangible things, pressure sensors-devices. Concepts It is Principles or Ideas, for example Performance can be a concept class. Remember by COPPET 4/26/2017 Module VII Object Analysis:Classification

21 Module VII Object Analysis:Classification
CRC approach Identify classes’ responsibilities(attributes and methods) and related classes that interact together 4/26/2017 Module VII Object Analysis:Classification

22 Module VII Object Analysis:Classification
Continued… 4/26/2017 Module VII Object Analysis:Classification

23 Module VII Object Analysis:Classification
Finding Structures Subclass Hierarchies Aggregations Component-Assembly Container-Contents Collection-Member Association 4/26/2017 Module VII Object Analysis:Classification

24 Superclass-Subclass Relationsh
Top-down approach Bottom-up approach Reusability approach (more details later at OOD) Multiple inheritance approach 4/26/2017 Module VII Object Analysis:Classification

25 Module VII Object Analysis:Classification
Aggregation A relationship between two classes where the instances of one class are in some way components, members, or contents of the instances of the other class Appear on the class diagram along with all the subclass hierarchies and the regular associations 4/26/2017 Module VII Object Analysis:Classification

26 Module VII Object Analysis:Classification
Aggregation 3 relationships that sometimes occur in an object model Whole-Part or Component-Assembly Container-Contents Collection-Member Improve communication and understanding 4/26/2017 Module VII Object Analysis:Classification

27 Module VII Object Analysis:Classification
Component-Assembly Constructed from its parts and an assembly-part situation physically exists A product and it’s components French soup consists of onion, butter, flour, wine, French bread, cheddar cheese, etc. 4/26/2017 Module VII Object Analysis:Classification

28 Module VII Object Analysis:Classification
Container A physical whole encompasses but is not constructed from physical parts A house can be considered a container for furniture and appliances 4/26/2017 Module VII Object Analysis:Classification

29 Module VII Object Analysis:Classification
Collection-Member A conceptual whole encompasses parts that may be physical or conceptual Teachers are assigned to specific courses A football team is a collection of players 4/26/2017 Module VII Object Analysis:Classification

30 Aggregation – 2 extra features
Transitivity If A is part of B and B is part of C, then A is part of C For example, a timing belt is part of an engine and an engine is part of a car; therefore, a timing belt is part of a car 4/26/2017 Module VII Object Analysis:Classification

31 Aggregation – 2 extra features...
Antisymmetry If A is part of B, then B is not part of A For example, an engine is part of a car, but a car is not part of an engine 4/26/2017 Module VII Object Analysis:Classification

32 Module VII Object Analysis:Classification
A filled diamond signifies the strong form of aggregation, e.g. assembly-component “Weak” forms of aggregation might be represented using a hollow diamond , e.g. Container and Collection 4/26/2017 Module VII Object Analysis:Classification

33 Module VII Object Analysis:Classification
Associations Location: next To, part of, contained in, ingredient of etc. cheese is an ingredient of French soup Communication: to, order to… a customer places an order with an operator 4/26/2017 Module VII Object Analysis:Classification

34 Module VII Object Analysis:Classification
Associations... Implementation: Defer implementation-specific associations to the design phase Ternary: Ternary or n-ary association is an association among more than two classes Directed actions (derived): can be defined in terms of other associations avoid these types of association - redundant 4/26/2017 Module VII Object Analysis:Classification

35 MODULE-IV OO Methodologies
ViaNet Bank ATM System The bank client must be able to deposit an amount to and withdraw an amount from his/her account using the touch screen at the ViaNet Bank ATM kiosk. Each transaction must be recorded, and the client must be able to review all transactions performed against a given account. Recorded transactions must include the date, time, transaction type, amount, and account balance after the transaction. No receipts will be provided for any account transactions. 4/26/2017 MODULE-IV OO Methodologies

36 MODULE-IV OO Methodologies
ViaNet Bank ATM System... The bank application operates for a single banking institution only. For each checking account, one related savings account can exist. A checking account differs from other bank accounts in that it often allows for numerous withdrawals and unlimited deposits, whereas savings accounts sometimes limit both. Access to the ViaNet accounts is provided by a PIN code consisting of 4 integer digits between 0 and 9. One PIN code allows access to all accounts held by a bank client. 4/26/2017 MODULE-IV OO Methodologies

37 MODULE-IV OO Methodologies
ViaNet Bank ATM System... Neither a checking nor a savings account can have a negative balance. The system should automatically withdraw money from a related savings account if the requested withdrawal amount on the checking account is more than the current balance. If the balance on a savings account is less than the withdrawal amount requested, the transaction will stop and the bank client will be notified. 4/26/2017 MODULE-IV OO Methodologies

38 The Noun Phase Approach
Account, Account Balance, Amount, Approval process, ATM Card, ATM Machine, Bank, Bank Client, Card, Cash, Check, Checking, Checking Account, Client, Envelope, Client’s Account, Currency, Dollar, (Four) Digits, Fund, (Invalid) PIN, Message, Money, Password, PIN, PIN Code, Record, Savings, Savings Account, Step, System, Transaction, Transaction History 4/26/2017 MODULE-IV OO Methodologies

39 The Noun Phase Approach…
Irrelevant Classes Envelope, Four Digits, Step Redundant Classes Client, Bank Client = BankClient Account, Client’s Account = Account PIN, PIN Code = PIN Checking, Checking Account = CheckingAccount Savings, Savings Account = SavingsAccount Fund, Money = Fund ATM Card, Card = ATM Card 4/26/2017 MODULE-IV OO Methodologies

40 The Noun Phase Approach…
Adjective Classes Not applicable Attribute Classes Amount Account Balance Invalid PIN Password Transaction History PIN 4/26/2017 MODULE-IV OO Methodologies

41 The Noun Phase Approach…
Statement of purpose ATM Machine: an interface to the ViaNet Bank ATM Card: a key to an account BankClient: an individual with a checkings account and possibly a savings account. Bank: clients belong to the bank Account: defines behaviours of account types CheckingAccount: withdrawal service SavingsAccount: models a client’s savings Transaction: keeps track of transaction data 4/26/2017 MODULE-IV OO Methodologies

42 MODULE-IV OO Methodologies
Common Class Patterns People Bank Client Places Nothing applicable here.(Lets consider For eg: Bank Branch) Tangible things and Devices ATM Machine 4/26/2017 MODULE-IV OO Methodologies

43 MODULE-IV OO Methodologies
Common Class Patterns... Events Account class, CheckingAccount(models a client’s checking account and provides more specialized withdrawal service), SavingsAccount, Transaction Organisation Classes: Bank class Concept Classes: N/A 4/26/2017 MODULE-IV OO Methodologies

44 MODULE-IV OO Methodologies
4/26/2017 MODULE-IV OO Methodologies

45 MODULE-IV OO Methodologies
Use Case Driven Approach: Identifying Classes And Behavior Through Sequence/Collaboration Modeling Develop sequence diagram classes becomes clear. The process of creating sequence or collaboration diagrams is a systematic way to think about how a use case (scenario) can take place; and By doing so, it forces you to think about objects involved in your application. 4/26/2017 MODULE-IV OO Methodologies

46 MODULE-IV OO Methodologies
4/26/2017 MODULE-IV OO Methodologies

47 Guidelines for Naming Classes
The class name should be singular. Eg: YouthMember. Use names with which the users or clients are comfortable. Eg WithdrawCash Choose the class name from standard vocabulary for the subject matter. The name of a class should reflect its intrinsic nature. Use readable names with capitalize words. Ex: LoanWindow 4/26/2017 MODULE-IV OO Methodologies

48 MODULE-IV OO Methodologies
CRC CRC cards: Classes, Responsibilities And Collaborators Developed by Cunningham, Wilkerson and Beck. CRC is a technique for identifying classes’ responsibilities therefore their attributes and methods. CRC helps in identifying classes. 4/26/2017 MODULE-IV OO Methodologies

49 MODULE-IV OO Methodologies
CRC… CRC cards are 4” x 6” index cards consisting of : The class name Its Super and Sub classes (if applicable) The responsibilities of the class. The names of other classes with which the class will collaborate to fulfill its responsibilities. Author 4/26/2017 MODULE-IV OO Methodologies

50 MODULE-IV OO Methodologies
CRC Layout 4/26/2017 MODULE-IV OO Methodologies

51 MODULE-IV OO Methodologies
CRC Card Example 4/26/2017 MODULE-IV OO Methodologies

52 MODULE-IV OO Methodologies
END of Chapter-7 4/26/2017 MODULE-IV OO Methodologies


Download ppt "MODULE:VII OBJECT ANALYSIS: CLASSIFICATION"

Similar presentations


Ads by Google