CH#3 Software Designing (Object Oriented Design) Prepared and designed by: Shams Ur Rehman Shinwari
Contents Objects and object classes An object-oriented design process Design evolution
Software design Design is process of describing, organizing, and structuring system components at architectural design level and detailed design level It Focused on preparing for construction Like developing blueprints
Objects An object is an entity that has a state and a defined set of operations that 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) that request these services when some computation is required.
Classes Classes are the block of codes which are designed for specific task. Classes consists of function and objects. classes define the objects in the system and their interactions.
Object-oriented design Object-oriented design is concerned with developing an object-oriented model of a software system to implement the identified requirements. The objects in an object-oriented design are related to the solution to the problem. There may be close relationships between some problem objects and some solution objects.
Object-oriented programming Object-oriented programming is concerned with realizing a software design using an object-oriented programming language(the language which support classes and objects of class), such as Java. An object-oriented programming language provides constructs to define object classes and a run-time system to create objects from these classes.
Class , Object and Attributes
Generalization hierarchy The Hierarchy which show the parent class and the sub-classes of that parent class. Classes lower down the hierarchy have the same attributes and operations as their parent classes but may add new attributes and operations or modify some of those from their parent classes. This means that there is one-way interchangeability.
Example of generalization hierarchy
Cont.… The class Manager has all of the attributes and operations of the class Employee but has, in addition, two new attributes that record the budgets controlled by the manager and the date that the manager was appointed to a particular management role.
Cont.… Similarly, the class Programmer adds new attributes that define the project that the programmer is working on and the programming language skills that he or she has. Objects of class Manager or Programmer may therefore be used anywhere an object of class Employee is required.
Association Model Association is a very general relationship and is often used in the UML(Unified modeling language) to indicate that either an attribute of an object is an associated object or the implementation of an object method
Cont.… Here is an association modal:
Object oriented design process Object oriented design process is divided into the following stages. 1. Understand and define the environment and the modes of use of the system. 2. Design the system architecture. 3. Identify the principal objects in the system. 4. Develop design models. 5. Specify object interfaces.
object-oriented design process Here is the process of object-oriented design by developing an example, design for the control software that is embedded in an automated weather station.
Layered architecture for weather mapping system
Cont.… 1. Data display layer: where objects are concerned with preparing and presenting the data in a human readable form. 2. Data archiving layer: where objects are concerned with storing the data for future processing.
Cont.… 3. Data processing layer: where objects are concerned with checking and integrating the collected data. 4. Data collection layer: where objects are concerned with acquiring data from remote sources.
Subsystems in the weather mapping system
Use Case Diagram A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse. Actors: An actor is a person, organization, or external system that plays a role in one or more interactions with your system. Actors are drawn as stick figures.
Cont.… Associations: Associations between actors and use cases are indicated in use case diagrams by solid lines. An association exists whenever an actor is involved with an interaction described by a use case. Associations are modeled as lines connecting use cases and actors to one another, with an optional arrowhead on one end of the line.
Data Flow Diagram A data flow diagram (DFD) illustrates how data is processed by a system in terms of inputs and outputs. As its name indicates its focus is on the flow of information, where data comes from, where it goes and how it gets stored.
Data Flow Diagrams Notations Process Notations: Process in data flow diagram is represented by rectangular box. A process transforms incoming data flow into outgoing data flow.
Data Flow Diagrams Notations Data store Notations. The data stores in Data Flow Diagram is represented by two parallel lines. Data stores are repositories of data in the system. They are sometimes also referred to as files.
Data Flow Diagrams Notations Dataflow Notations. Dataflow are pipelines through which packets of information flow. Label the arrows with the name of the data that moves through it.
Data Flow Diagrams Notations External Entity Notations: External entities are objects outside the system, with which the system communicates. External entities are sources and destinations of the system's inputs and outputs.