Presentation is loading. Please wait.

Presentation is loading. Please wait.

Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 7 Title : Object Oriented Analysis and Design Reading: I. Sommerville,

Similar presentations


Presentation on theme: "Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 7 Title : Object Oriented Analysis and Design Reading: I. Sommerville,"— Presentation transcript:

1 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 7 Title : Object Oriented Analysis and Design Reading: I. Sommerville, Chap. 12 + extra support

2 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville2 Object Oriented analysis Objects are abstractions of real-world or system entities… Objects are independent and encapsulate state… System functionality is expressed in terms of object services… Objects communicate by message passing…

3 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville3 What is an object ? An object is an entity which has a state and a defined set of operations which operate on that state. The state is represented as a set of object attributes. The operations associated with the object provide services to other objects (clients) which request these services when some computation is required. Objects are created according to some object class definition. An object class definition serves as a template for objects. It includes declarations of all the attributes and services which should be associated with an object of that class.

4 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville4 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set of objects with common attributes and the services (operations) provided by each object

5 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville5 OO analysis, how to proceed ? The identification of objects, their attributes and services The organization of objects into an aggregation hierarchy The construction of dynamic object-use descriptions which show how services are used The specification of object interfaces

6 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville6 Object models Various object models may be produced Objects models Inheritance models Aggregation models Service models

7 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville7 Object models Natural ways of reflecting the real-world entities manipulated by the system More abstract entities are more difficult to model using this approach Object class identification is recognized as a difficult process requiring a deep understanding of the application domain Object classes reflecting domain entities are reusable across systems

8 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville8 Object class notation

9 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville9 Object identification Identifying objects is the most difficult part of object oriented design. There is no 'magic formula' for object identification. It relies on the skill, experience and domain knowledge of system designers. Object identification is an iterative process. You are unlikely to get it right first time

10 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville10 Approaches to identification Use a grammatical approach based on a natural language description of the system (used in Hood method) Base the identification on tangible things in the application domain Use a behavioural approach and identify objects based on what participates in what behaviour

11 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville11 An office information system The Office Information Retrieval System (OIRS) is an automatic file clerk which can file documents under some name in one or more indexes, retrieve documents, display and maintain document indexes, archive documents and destroy documents. The system is activated by a request from the user and always returns a message to the user indicating the success or failure of the request.

12 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville12 Inheritance models Organise the domain object classes into a hierarchy Classes at the top of the hierarchy reflect the common features of all classes Object classes inherit their attributes and services from one or more super-classes. these may then be specialised as necessary Class hierarchy design is a difficult process if duplication in different branches is to be avoided

13 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville13 Library class hierarchy

14 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville14 User class hierarchy

15 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville15 Advantages of inheritance It is an abstraction mechanism which may be used to classify entities It is a reuse mechanism at both the design and the programming level The inheritance graph is a source of organisational knowledge about domains and systems

16 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville16 Multiple inheritance Rather than inheriting the attributes and services from a single parent class, a system which supports multiple inheritance allows object classes to inherit from several super-classes Can lead to semantic conflicts where attributes/services with the same name in different super-classes have different semantics Makes class hierarchy reorganisation more complex

17 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville17 Multiple inheritance

18 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville18 Object aggregation Aggregation model shows how classes which are collections are composed of other classes Similar to the part-of relationship in semantic data models

19 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville19 Object aggregation

20 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville20 Service-usage models These models show how services provided by one object are used by other objects Must be used sparingly as, obviously, some objects provide common services which are used by many other objects in the system

21 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville21 Service usage

22 Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville22 Object interface design Concerned with specifying the detail of the object interfaces. This means defining attribute types and the signatures and semantics of object operations Representation information should be avoided Precise specification is essential so a programming language description should be used


Download ppt "Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 7 Title : Object Oriented Analysis and Design Reading: I. Sommerville,"

Similar presentations


Ads by Google