Sie sind auf Seite 1von 42

OBJECT ORIENTED ANALYSIS AND DESIGN

UNIT 1 Software development is dynamic and always undergoing major change. Today a vast number of tools and methodologies are available for system development. System development refers to all activities that go into producing information system solution. System development activities consist of system analysis, modeling, design, implementation, testing and maintenance. A software development methodology is series of processes that, if followed, can lead to the development of an application. The original goal based on the system requirements. Further we study about the unified approach, which is the methodology used for learning about object oriented system development. Object Oriented !OO" systems development is a way to develop software by building self contained modules that can be more easily# $eplaced %odified $eused.

Orthogonal View of the Software: A software system is a set of mechanism for performing certain action on certain data &Algorithm ' (ata structure ) *rogram Object Oriented System Develo ment !ethodology: OO development offers a different model from the traditional software development approach. This is based on functions and procedures. To develop s+w by building self contained modules or objects that can be easily replaced, modified and reused. ,n OO environment , s+w is a collection of discrete object that encapsulate their data as well as the functionality to model real world &objects -ach object has attributes !data" and method !function". Objects grouped in to classes and object are responsible for itself A chart object is responsible for things li.e maintaining its data and labels and even for drawing itself.

"enefits of Object Orientation Faster development, $eusability, ,ncreased quality Object technology emphasi/es modeling the real world and provides us with the stronger equivalence of the real world0s entities !objects" than other methodologies. $aising the level of abstraction to the point where application can be implemented in the same terms as they are described# $hy object orientation% To create sets of objects that wor. together concurrently to produce s+w that better, model their problem domain that similarly system produced by traditional techniques. ,t adapts to 1. 2hanging requirements 3. -asier to maintain 4. %ore robust

5. *romote greater design 6. 2ode reuse 7igher level of abstraction Seamless transition among different phases of software development -ncouragement of good programming techniques *romotion of reusability roach

Overview of the Unified &

The unified approach !8A" is a methodology for software development that is used in this boo.. The 8A, based on methodologies by 9ooch, $umbaugh, :acobson, and others, tries to combine the best practices, processes, and guidelines. 8A based on methodologies by 9ooch, $umbaugh and :acobson tries to combine the best practices, processes and guidelines along with the object management groups in unified modelling language. 8%; is a set of notations and conventions used to describe and model an application. 8A utili/es the unified modeling language !8%;" which is a set of notations and conventions used to describe and model an application.

O"'()T "&SI)S: *oals: (efine Objects and classes (escribe objects0 methods, attributes and how objects respond to messages, < (efine *olymorphism, ,nheritance, data abstraction, encapsulation, and protocol, (escribe objects relationships, (escribe object persistence, 8nderstand meta classes. $hat is an object% The term object was first formally utili/ed in the similar language to simulate some aspect of reality. An object is an entity. o ,t .nows things !has attributes" o ,t does things !provides services or has methods"

-=ample# ,t >nows things !attributes" Attributes , am an -mployee. , .now my name, social security number and my address. , am a 2ar. , .now my color, manufacturer, cost, owner and model.

,t does things !methods"

, .now how to compute my payroll.

Attributes or properties describe object0s state !data" and methods define its behavior.

Object: ,n an object oriented system, everything is an object# numbers, arrays, records, fields, files, forms, an invoice, etc. An Object is anything, real or abstract, about which we store data and those methods that manipulate the data. 2onceptually, each object is responsible for itself. A window object is responsible for things li.e opening, si/ing, and closing itself. A chart object is responsible for things li.e maintaining its data and labels, and even for drawing itself.

Two "asic +,estions ?hen developing an O O application, two basic questions always arise. ?hat objects does the application need@ ?hat functionality should those objects have@ Traditional & roach The traditional approach to software development tends toward writing a lot of code to do all the things that have to be done. Aou are the only active entity and the code is just basically a lot of building materials. roach

Object-Oriented &

OO approach is more li.e creating a lot of helpers that ta.e on an active role, a spirit, that form a community whose interactions become the application. Object.s &ttrib,tes Attributes represented by data type. They describe objects states. ,n the 2ar e=ample the car0s attributes are# color, manufacturer, cost, owner, model, etc.

Object.s !ethods %ethods define objects behavior and specify the way in which an Object0s data are manipulated. ,n the 2ar e=ample the car0s methods are# drive it, loc. it, tow it, carry passenger in it.

Objects are *ro, ed in )lasses The role of a class is to define the attributes and methods !the state and behavior" of its instances. The class car, for e=ample, defines the property color.

-ach individual car !object" will have a value for this property, such as Bmaroon,B ByellowB or Bwhite.B

)lass /ierarchy An object oriented system organi/es classes into subclass super hierarchy. At the top of the hierarchy are the most general classes and at the bottom are the most specific A subclass inherits all of the properties and methods !procedures" defined in its super class.

%otor Cehicle

9us

Truc.

2ar

Inheritance 0 rogramming by e1tension2 ,nheritance is a relationship between classes where one class is the parent class of another !derived" class. ,nheritance allows classes to share and reuse behaviors and attributes. The real advantage of inheritance is that we can build upon what we already have and, $euse what we already have.

Vehicle )ar , .now how to stop Stop method is reusable

3ord

!,stang

Ta,r,s

Th,nderbird

, don0t .now how to stop stop !my%ustang" !,lti le Inheritances OO systems permit a class to inherit from more than one superclass. This .ind of inheritance is referred to as multiple inheritance.

3or e1am le ,tility vehicle inherent from )ar and Tr,c4 classes#

!otorVehicle

Tr,c4

)ar

",s

UtilityVehicle

(nca s,lation and Information /iding D ,nformation hiding is a principle of hiding internal data and procedures of an object. 9y providing an interface to each object in such a way as to reveal as little as possible about its inner wor.ings. -ncapsulation protects the data from corruption.

!essage Objects perform operations in response to messages. For e=ample, you may communicate with your computer by sending it a message from hand help controller. & )ase St,dy - & 5ayroll 5rogram 2onsider a payroll program that processes employee records at a small manufacturing firm. This company has three types of employees# %anagers# $eceive a regular salary. Office ?or.ers# $eceive an hourly wage and are eligible for overtime after 5E hours. *roduction ?or.ers# Are paid according to a piece rate.

Str,ct,red &

roach

FO$ -C-$A -%*;OA-- (O 9-F,G ,F employee ) manager T7-G 2A;; compute%anagerSalary ,F employee ) office wor.er T7-G 2A;; computeOffice?or.erSalary

,F employee ) production wor.er T7-G 2A;; compute*roduction?or.erSalary -G( $hat if we add two new ty es of em loyees% Temporary office wor.ers ineligible for overtime, junior production wor.ers who receive an hourly wage plus a lower piece rate. FO$ -C-$A -%*;OA-- (O 9-F,G HHHHHHHHHHH. HHHHHH. ,F employee ) manager T7-G ,F employee ) temporary office wor.er T7-G 2A;; computeTemporaryOffice?or.erSalary ,F employee ) junior production wor.er T7-G 2A;; compute:unior*roduction?or.erSalary-G(

&n Object-Oriented &

roach

?hat objects does the application need@ The goal of OO analysis is to identify objects and classes that support the problem domain and systemIs requirements. Some general candidate classes are# *ersons *laces Things )lass /ierarchy ,dentify class hierarchy ,dentify commonality among the classes (raw the general specific class hierarchy. ( m l oy ee n a m e a d d r e s s s a l a r y S S J

)las s /ier arch y

Office$or4er

!anager K data-ntry

5rod,ction$or4er

data-ntry 2ompute*ayroll 2ompute*ayroll print$eport print$eport

data-ntry 2ompute*ayroll print$eport

OO &

roach

FO$ -C-$A -%*;OA-- (O 9-F,G employee compute*ayroll -G( 5olymor hism *olymorphism means that the same operation may behave differently on different classes. -=ample# compute*ayroll &ssociations The concept of association represents relationships between objects and classes. For e=ample a pilot can fly planes

*ilot

can fly

flown by

*lanes

Objects and 5ersistence Objects have a lifetime. An object can persist beyond application session boundaries, during which the object is stored in a file or a database, in some file or database form. !eta-)lasses -verything is an object. 7ow about a class@ ,s a class an object@ Aes, a class is an objectL So, if it is an object, it must belong to a class. ,ndeed, class belongs to a class called a %eta 2lass or a classI class. %eta class used by the compiler. For e=ample, the meta classes handle messages to classes, such as constructors and Bnew.B

$ather than treat data and procedures separately, object oriented programming pac.ages them into Bobjects.B O O system provides you with the set of objects that closely reflects the underlying application. Advantages of object oriented programming are# The ability to reuse code, develop more maintainable systems in a shorter amount of time. more resilient to change, and more reliable, since they are built from completely tested and debugged classes.

Object Oriented Systems Develo ment 6ife )ycle The software develo ment rocess ",ilding high-7,ality software Object-oriented systems develo ment Use-case driven systems develo ment 5rototy ing 8a id a lication develo ment )om onent-based develo ment )ontin,o,s testing and re,sability

Software 5rocess The essence of the software process is the transformation of 8sers0 needs to The application domain into A software solution.

Traditional $aterfall &

roach to Systems Develo ment $hat /ow Do It Test Use of -ngineering

Software +,ality There are two basic approaches to systems testing. ?e can test a system according to how it has been built. Alternatively, we can test the system with respect to what it should do.

+,ality !eas,res Systems can be evaluated in terms of four quality measures# M M M M 2orrespondence 2orrectness Cerification Calidation

2orrespondence measures how well the delivered system corresponds to the needs of the operational environment. ,t cannot be determined until the system is in place.

Needs

8e7,irementsDesign

Software

2orrespondence 2orrectness measures the consistency of the product requirements with respect to the design specification.

Needs

8e7,irementsDesign

Software

2orrectness

Cerification BAm , building the product right@B Calidation BAm , building the right product@B Calidation Cerification

Needs

8e7,irementsDesign

Software

Cerification is to predict the correctness. Calidation is to predict the correspondence#

Object-Oriented Systems Develo ment &

roach

",ild Use-)ases Object analysis Validate9 test O-O &nalysis

Iteration and 8e,se

Using TOO6S

User )&S( attrib,tes and and9or satisfactio OO methods rogramin n g Usability : lang,ages +& Tests O-O Design O-O Im lementation

Design classes; define

",ild object : dynamic mode l

",ild UI and rototy e

User satisfaction test; ,sability test 7,ality ass,rance test

Object-Oriented Systems Develo ment activities Object oriented analysis. Object oriented design. *rototyping. 2omponent based development. ,ncremental testing.

Use-case driven systems develo ment 8se 2ase, is a name for a scenario to describe the userMcomputer system interaction.

Use case models9 doc,mn et OO&: Identify &ctors Object interaction diagram; etc# Dynamic model OO&: Object !odel OO&: Use case !odel Design classes UI OOD: Dynamic model OO&: )o,rses of action

Testing: Usage Scenarios

Object-Oriented &nalysis OO analysis concerns with determining the system requirements and identifying classes and their relationships that ma.e up an application. Object-Oriented Design The goal of object oriented design !OO(" is to design The classes identified during the analysis phase, The user interface and (ata access.

OOD activities incl,de: o (esign and refine classes. (esign and refine attributes. (esign and refine methods. (esign and refine structures. (esign and refine associations.

o (esign 8ser ,nterface or Ciew layer classes. o (esign data Access ;ayer classes.

5rototy ing o A *rototype enables you to fully understand how easy or difficult it will be to implement some of the features of the system. o ,t can also give users a chance to comment on the usability and usefulness of the design. Ty es of 5rototy es o A hori/ontal prototype is a simulation of the interface. o A vertical prototype is a subset of the system features with complete functionality. o An analysis prototype is an aid for e=ploring the problem domain. o A domain prototype is an aid for the incremental development of the ultimate software solution. )om onent-based develo ment 0)"D2 29( is an industriali/ed approach to the software development process. Application development moves from custom development to assembly of pre built, pre tested, reusable software components that operate with each other. ms )om on ent wra er

S,b sele ct and ente r title her e

6egacy rogra

)om onent wra )om onent wra er

er

)om on ent wra er 6egacy screens 6egacy software ac4ages

6egacy data

O en )onnectivity

8a id &

lication Develo ment 08&D2

$A( is a set of tools and techniques that can be used to build an application faster than typically possible with traditional methods. $A( does not replace S(;2 but complements it, since it focuses more on process description and can be combined perfectly with the object oriented approach.

Incremental Testing Software development and all of its activities including testing are an iterative process. ,f you wait until after development to test an application for bugs and performance, you could be wasting thousands of dollars and hours of time.

8e,sability A major benefit of object oriented systems development is reusability, and this is the most difficult promise to deliver on. 8e,se strategy ,nformation hiding !encapsulation". 2onformance to naming standards. 2reation and administration of an object repository. -ncouragement by strategic management of reuse as opposed to constant redevelopment.

-stablishing targets for a percentage of the objects in the project to be reused !i.e., 6E percent reuse of objects".

The essence of the software process is the transformation of users0 needs into a software solution. The O O S(;2 is an iterative process and is divided into analysis, design, prototyping+ implementation, and testing.

O"'()T O8I(NT(D !(T/ODO6O*I(S 8,mba,gh !ethodologies "ooch !ethodology 'acobson !ethodology "asic Definition A methodology is e=plained as the science of methods. A method is a set of procedures in which a specific goal is approached step by step. %any methodologies are available to choose from for system development. 7ere, we loo. at the methodologies developed by $umbaugh et al., 9ooch, and :acobson which are the origins of the 8nified %odeling ;anguage !8%;" and the bases of the 8A

Strength of the !ethods < $umbaug #(escribing Object %odel or the static structure of the system :acobson# good for producing user driven analysis models 9ooch # (etailed object oriented design models

8,mba,gh !ethodologies O%T !Object %odeling Technique" describes a method for the analysis, design, and implementation of a system using an object oriented technique. 2lass attributes, method, inheritance, and association also can be e=pressed easily 5hases of O!T

Analysis System (esign Object (esign ,mplementation

O!T consists of fo,r hases; which can be erformed iteratively: Analysis. The results are objects and dynamic and functional models. System design. The result is a structure of the basic architecture of the system. Object design. This phase produces a design document, consisting of detailed objects and dynamic and functional models. ,mplementation. This activity produces reusable, e=tendible, and robust code.

O!T !odeling O!T se arates modeling into three different arts# An object model, presented by the object model and the data dictionary. A dynamic model, presented by the state diagrams and event flow diagrams. A functional model, presented by data flow and constraints. "ooch !ethodology The 9ooch methodology covers the analysis and design phases of systems development. 9ooch sometimes is critici/ed for his large set of symbols. The 9ooch method consists of the following diagrams# o 2lass diagrams o Object diagrams o State transition diagrams o %odule diagrams o *rocess diagrams o ,nteraction diagrams 2ar

color manufacturer superclass cost inherits Ford

inherits -sco rt Taurus

%ustang

The "ooch methodology rescribes M A macro development process M A micro development process.

The !acro Develo ment 5rocess ,t servers as a controlling framewor. for the micro process. The primary concern is Technical %anagement of the System. The macro development process consists of the following steps# 1. 2onceptuali/ation 3. Analysis and development of the model.

4. (esign or create the system architecture. 5. -volution or implementation. 6. %aintenance. )once t,ali<ation: -stablish the core requirements of the system -stablish a set of goals and develop prototype to prove the concept

&nalysis and develo ment of the modal 8sing the class diagram to describe the roles and responsibilities objects are to carry out in performing the desired behavior of the system 8sing the object diagram to describe the desired behavior of the system in terms of scenarios or, alternatively 8sing the interaction diagram to describe behavior of the system in terms of scenarios

Design or create the system architect,re 8sing the class diagram to decide what mechanisms are used to regulate how objects collaborate 8sing the module diagram to map out were each class and object should be declared 8sing the process diagram to determine to which processor to allocate a process. Also, determine the schedules for multiple processes on each relevant processor

(vol,tion or im lementation Successively refine the system through many iterations *roduce a stream of software implementations, each of which is refinement of the prior one

!aintenance %a.e locali/ed changes to the system to add new requirements and eliminate bugs

The !icro Develo ment 5rocess The micro development process consists of the following steps# ,dentify classes and objects.

,dentify class and object semantics. ,dentify class and object relationships. ,dentify class and object interfaces and implementation.

'acobson !ethodologies The :acobson et al. methodologies !e.g., OO9-, OOS-, and Objectory" cover the entire life cycle and stress traceability between the different phases. Object-Oriented Software (ngineering: Objectory Object oriented software engineering !OOS-", also called Objectory, is a method of object oriented development with the specific aim to fit the development of large, real time systems. Objectory is built around several different models# 8se case model. (omain object model. Analysis object model. ,mplementation model. Test model

Object-Oriented ",siness (ngineering 0OO"(2 Object oriented business engineering !OO9-" is object modeling at the enterprise level. 8se cases again are the central vehicle for modeling, providing traceability throughout the software engineering processes.

OO"( consists of : M M M M Analysis phase (esign ,mplementation phases and Testing phase.

(esign *atterns#
(esign pattern is instructive information for that captures the essential structure and insight of a successful family of proven design solutions to a recurring problem that arises within a certain conte=t. Fang Of Four !FoF" N-rich Famma, $ichard 7elm, $alph :ohnson and :ohn ClissidesO introduced the concept of design patterns. 2haracteristics of (esign *atterns#
1. ,t solves the problem M (esign patterns are not just abstract representations of theoretical research. To be accepted as a pattern it should have some proves practical e=periences.

3. ,tPs a proven concept M *atterns must have a successful history. 4. ,t describes a relationship M *atterns do not specify a single class instead it specifies more than one classes and their relationship. 5. ,t has a human component Food patterns ma.e the job of the programmer easy and time saving. 2ontents of (esign *attern# Game of the pattern is used to identify the pattern as well as an descriptive of the problem solution in general. -asy to remember and conte=t related names ma.es remembering patterns easy. 2onte=t of the pattern describes when and where the pattern is applicable. ,t also describes the purpose of pattern and also the place where it is not applicable due to some specific conditions. Solution of the design pattern is describes how to build the appropriate design using this appropriate design. 2onsequences of design patterns describe the impact of choosing a particular design pattern in a system.

*attern Template# 1. *ATT-$G GA%- !good and relevant names ma.e patterns easy to remember"

,GT-GT !?hich problem does the pattern solve" A;SO >GO?G AS!alias names given to the pattern" A**;,2A9,;,TA!when should this pattern be applied" ST$82T8$-!Fraphical representation of the *attern !using 8%;"" *A$T,2,*AGTS!classes and objects ta.ing part in the pattern and their relationship" 2O;;A9O$ATO$S !says how objects+actors interact to achieve the goal". 2OGS-T8-G2-S !how does they solve the problem and what are the consequences if the problem is solved by this way." U. ,%*;-%-GTAT,OG !,ssues related with ,mplementation, language specific issues" 1E. >GO?G 8S-S !-=amples of the same pattern used in real systems" 11. $-;AT-( *ATT-$GS !Specify is there any similar patterns. ?here are they used." The Singleton (esign *attern# 1. *attern Game M Singleton 3. ,ntent M To ensure a class has only one instance a global point of access to it.
4. %otivation M ,ts common in software development where some component developers specify that more than one object of a 2lass alive ma.e systems ambiguous.

3. 4. 5. 6. Q. R. S.

5. Applicability M Singleton can be used where there must be e=actly one object and it must be accessible to multiple clients+objects. 6. Structure# Singleton
Static int count VOther singleton dataV

Static singleton V createW,nstan ce!"

VOther singleton behaviourV

Q. *articipants M Singleton class defines a 2lass function which can be accessed by the clients for creating instance. R. 2ollaborations M 2lients access a singleton object solely through instance operation. S. 2onsequences M 2ontrolled access to the single instance, $educed name space, can be sub classed and more behaviors can be added, and can be modified for e=istence of more than one objects!9AS-( OG T7- (O%A,G".

Framewor.s#
Framewor.s are the way of delivering application development patterns to support+share best development practice during application development.
,n general framewor. is a generic solution to a problem that can be applied to all levels of development. (esign and Software framewor.s and most popular where (esign pattern helps on (esign phase and software framewor.s help in 2omponent 9ased (evelopment phase.

Framewor. groups a set of classes which are either concrete or abstract. This group can be sub classed in to a particular application and recomposing the necessary items.

a. Framewor.s can be inserted in to a code where a design pattern cannot be inserted. To include a design pattern the implementation of the design pattern is used.
b. (esign patterns are instructive informationX hence they are less in space where Framewor.s are large in si/e because they contain many design patterns.

c. Framewor.s are more particular about the application domain where design patterns are less specified about the application domain.

!8nified %odeling ;anguage"


%odel $epresents an abstract of the system. ,t is build prior to the original system. ,t can be used to ma.e a study on the system and also can be used to analy/e the effect of changes on the system. %odels are used in all disciplines of engineering. Static %odel $epresents the static structure of the system. Static models are stable and they donPt change over time. -.g. 2lass diagram. (ynamic %odel 2ollection of diagrams that represents the behavior of the system over time. ,t shows the interaction between various objects over time. -.g. ,nteraction (iagram. A model includes a" %odel -lements M Fundamental modeling concepts and semantics.

b" Gotation M Cisual rendering of model elements. c" Fuidelines M -=pression of usage. %odeling# Technique of creating models. ,t is also a good medium of communication between developers at various levels. Advantages# 2larity M Cisual representations are mode clear and informative than listed or written documents. %issed out details can be easily found out. Familiarity M Similar modeling language and techniques is followed by developers wor.ing in same domain. %aintenance M 2hanges can be made easily in visual systems and changes can be confirmed easily. Simplification M %ore comple= structures can be represented in an abstract manner to deliver the conceptual idea.

8nified %odeling ;anguage#

,tPs a language for modeling software systems. This language is used for specifying, visuali/ing, constructing and documenting software systems through out the development. !%ostly object oriented development".8%; is used to model systems build through 8nified Approach. 8nified Approach combines the methodologies of 9ooch, $umbaugh and :acobson. %odels can be represented at different levels based on the abstraction and refinement. A complete model can be obtained only after continuous refinement of 8%; diagrams.

8%; is composed of U graphical diagrams# 1" 2lass (iagram 3" 8se M 2ase (iagram 4" 9ehavior (iagram a. ,nteraction (iagram i. Sequence (iagram ii. 2ollaboration (iagram b. State 2hart (iagram c. Activity (iagram 5" ,mplementation (iagram a. 2omponent (iagram b. (eployment (iagram

8%; 2lass (iagram#


2lass diagram represents the types of objects in the system and the various .inds of static relationships that e=ist between them. 2lass diagrams are used in object modeling where real world objects are mapped to logical objects in computer program. Gotations and symbols used in 2lass diagrams are 1" 2lass Gotation 3" Object (iagram 4" 2lass ,nterface Gotation 5" 9inary Association Gotation and Association $ole 6" Tualifier Q" %ultiplicity R" O$ Association S" Association 2lass

U" G M A$A Association 1E" Aggregation and 2omposition

11" Fenerali/ation

4" 2lass

1" 2lass Gotation#

2lasses are represented in a rectangular bo=. The top bo= has the name, the middle one has the attributes+properties+data members and the lower one has the behavior+ member functions+ methods. A 9o= with a class name represents the most abstract representation of a class. -.g. Cehicle

Cehicle

Cehicle

2olor 9rand Owner

2olor 9rand Owner J(rive!" 'Stop!" Turn!" $everse!"

All the above diagrams represent the same class in different levels of abstraction. Cisibility of members can be specified using , ' and J symbols. indicates a private member ' indicates a public member

# indicates a protected member. 3" Object (iagram#


Object diagram is an instance of a class diagram. ,t gives a detailed state of a system at a particular point of time. 2lass diagrams can contain objects and Object diagram cannot contain classes. 7ence 2lass diagram with objects and no classes is called an object diagram.

%y car 2olor# red 9rand# Ford Owner# %r. (oss


,t represents the e=ternally visible behavior of a class. -=ternally visible behaviors are public members. The notation is small circle with a line connected to a class.

*rint

*rint 2ontrol

5" 9inary Association Gotation and association role#


,t represents the association between two classes represented by a straight line connecting 3 classes. Association has got a name written on the line and association role

?or.s for 2ompany -mployer -mployee *erson

,n the above diagram ?or.s for is the association that e=ist between *erson and 2ompany. The arrow mar. indicates the direction of association. i.e., The *erson ?or.s for the company.
Association $ole# itPs related to association. -ach class that is a member of an association plays a role in the association called association role. -.g. The person plays the role of

-%*;OA-- in the ?O$>S FO$ association where a company plays the role of -%*;OA-$.

6" Tualifier# Tualifier is an attribute of an association. ,t ma.es the association more clear.

maintains

*erson

Account

9an.

The qualifier here is the account and it defines that each instance of account is related to 1 or 3 person. 7ence the account qualifies the association maintains. Q" %ultiplicity# ,t gives the range of associated classes. ,t is specified of the

form lower bound..upper bound or integer. ;ower bound must be an integer where upper bound can be an integer or a V. V (enotes many.

?hen a multiplicity is stated at one end it states that each class at the other end can have relation with stated number of classes at the nearer end. -.g#

The below diagrams says that each course can have any number of students O$ each student may attend any number of courses. Also each department has one or more courses and a course may belong to one or more departments.

(ept
1..V has 1..V

Student

attends

2ourse

R" O$ M Association#
,tPs a relation in which a class is associated to more than one class and only one association is instantiated at any instance of time for an object. ,t is represented by a dashed line connecting two associations. A constraint string can be used to label the O$ association line.

2O%*AGA 2A$

YorZ

,s owned by

*-$SOG

S" Association 2lass#


,tPs an association that has class properties. The association class is atta.ched to an

association with a dashed line ?or.s for emplo yer emplo yee

2ompany

*erson

?or.s For Salary

7ere the wor.s for relation has got one attribute salary. 7ence an association class is maintained.

U" G M Ary Association#


,tPs an association where more classes participate. They are connected by a big diamond

and the name of the association is named near the line

college

1..V studies

2lass

Student

class

%ar. Sem %ar.NSO avg

1E" Aggregation and 2omposition# Aggregation is a 0part M ofP association. 2ontainment is a type of aggregation with wea. ownership where composition is a part of relationship with strong owner ship.

8nit M ,,

Object Analysis# 2lassification


2lassification#
,tPs the technique of identifying the class of an object rather than individual objects. ,n other words itPs the process of chec.ing whether the object belong to particular category or not.

2lassification Theory#

%any persons introduced many theories for classification. 1. 9ooch# 2lassification guides us in ma.ing good decisions for modulari/ation using the property of sameness. The identified classes can be placed in same module or in different module based on the sameness. Sameness+ Similarity can be measured with coupling and cohesion. 2ohesion is the measure of dependency between the classes+pac.ages+components in a module where coupling is the measure of dependency between different modules. ,n real software development prefers wea. coupling and strong cohesion. 3. %artin and Odell# 2lassification can be used for well understanding of concept N9uilding 9loc.sO.These classes iteratively represent the refinement job during design. 2lasses also act as an inde= to various implementations. 4. Tou and Fon/ale/# -=plained classification based on physicophysiology i.e., the relation between the person and the system. ?hen a person is introduced to a system the human intelligence may help him to identify a set of objects and classes which later can be refined.

2lassification Approaches#
%any approaches have been introduced for identifying classes in a domain. The most used ones are 1. 3. 4. 5. Goun *hrase Approach 8se M 2ase driven Approach 2ommon 2lass Approach 2lass $esponsibilities and 2ollaborators

1. Goun *hrase Approach#


The classes are identified from the GO8G *7$AS-S that e=ist in the requirements+ use case. The steps involved are

1. 3. 4. 5.

-=amining the use case+ requirements. Gouns in te=tual form are selected and considered to be the classes. *lural classes are converted into singular classes. ,dentified classes are grouped into 4 categories a. ,rrelevant 2lasses M They are the unnecessary classes b. $elevant 2lasses M They are the necessary classes c. Fu//y 2lasses They are the classes where e=ist some uncertainty in their e=istence. 6. ,dentify candidate classes from above set of classes.

Fuidelines for selecting candidate classes from $elevant, ,rrelevant and Fu//y set of classes.
1. $edundant 2lasses M Gever .eep two classes that represent similar information and behavior. ,f there e=ist more than one name for a similar class

select the more relevant name. Try to use relevant names that are use by the user. !-.g. 2lass Account is better than 2lass %oneysaving"
3. Adjective 2lasses M An adjective qualifies a noun !2lass". Specification of adjective may ma.e the object to behave in a different way or may be totally irrelevant. Gaming a new class can be decided how far the adjective changes the behavior of the class. !-.g. The behavior of 2urrent Account 7older differs from the behavior of Savings Account 7older. 7ence they should be named as two different classes. ,n the other case the toper adjective doesnPt ma.e much change in the behavior of the student object. 7ence this can be added as a state in the student class and no toper class is named"

4. Attribute 2lass M Some classes just represent a particular property of some objects. They should not be made as a class instead they can be added as a property in the class. !-.g. Go %inimum 9alance, 2redit limit are not advised to named as a class instead they should be included as an attribute in Account class". 5. ,rrelevant 2lass M These classes can be identified easily. ?hen a class is identified and named the purpose and a description of the class is stated and those classes with no purpose are identified as irrelevant classes. !-.g .2lass Fan identified in the domain of attendance management system is irrelevant when u model the system to be implemented. These type of classes can be scraped out."

The above steps are iterative and the guidelines can be used at any level of iteration. The cycles of iteration is continues until the identified classes are satisfied by the analyst+ designer. The iterative *rocess can be represented as below

$eview and eliminate redundant classes

$eview irrelevant classes

$eview Adjectives

$eview Attributes

3. 2ommon 2lass *atterns Approach#


A set of classes that are common for all domains are listed and classes are identified based on that category. The set of class category is listed based on the previous .nowledge !*ast -=perience". The 2lass *atterns are 1. 2oncept 2lass o This category represents a set of classes that represent the whole business activity !2oncept". The never contains peoples or events. These classes represent the entire concept in an abstract way. !-.g. Savings9an. 2lass" 3. -vents 2lass
o

4. Organi/ation 2lass o These are the category of classes that represent a person, group of person, resources and facilities. %ostly a group of organi/ation class has a defined mission !target or tas.". !-.g. 2S-(-*T 2lass represents a group of employees who belongs to (ept of 2S-". 5. *eople 2lass o This category contains the individuals who play some role in the system or in any association. These people carry out some functions that may be some triggers. *eople class can be viewed as a subcategory of Organi/ation class. This category again contains 3 subsets i. *eople who use the system !-.g. (ata -ntry Operator who use the system for entering attendance may not be an employee of the college but a contract staff." ii. *eople who do not use the system but they play some role in the system. !-.g. ;ecturer, Students, ,nstructor etc" 6. *lace 2lass o This category of classes represents physical locations which is needed to record some details or the place itself is recorded in detail. !-.g. ,nformation about 9;O2>1 where 2S- dept functions". Q. Tangible things and (evice 2lass o This category includes tangible objects and devices li.e sensors involved in the system.

These are the category of classes that represent some event at a particular instance of time. %ostly they record some information. !-.g. Transaction 2lass"

Das könnte Ihnen auch gefallen