CHAPTER-1 What Is Object-Orientation-Object-oriented (OO) we consider software as a collection of discrete objects that incorporate both data structure and behavior. The characteristics required by an OO approach, generally include identity, classification, inheritance, and polymorphism. Identity means that data is quantized into discrete, distinguishable entities. object is a real world entity which is distinguishable within the environment. Classification means that objects with the same data structure (attributes) and behavior (operations) are grouped into a class. Paragraph, Monitor, and ChessPiece are examples of classes. Each object is said to be an instance of its class. Inheritance is the sharing of attributes and operations (features) among classes based on a hierarchical relationship. A superclass has general information that subclasses refine and elaborate. Each subclass incorporates, or inherits, all the features of its superclass and adds its own unique features. Polymorphism means that the same operation may behave differently for different classes. An implementation of an operation by a specific class is called a method. OO ThemesAbstraction--Abstraction focus on essential aspects of an application while ignoring details. This means focusing on what an object is and does, before deciding how to implement it. Encapsulation--Encapsulation (also information hiding) separates the external aspects of an object, that are accessible to other objects, from the internal implementation details, that are hidden from other objects. Sharing--OO techniques promote sharing at different levels. Inheritance of both data structure and behavior lets subclasses share common code. Emphasis on the Essence of an Object--OO technology stresses what an object is, rather than how it is used. The uses of an object depend on the details of the application and often change during development. Synergy--Identity, classification, polymorphism, and inheritance characterize OO languages. Each of these concepts can be used in isolation, but together they complement each other synergistically. CHAPTER--2 Modeling as a Design Technique A model is an abstraction of something for the purpose of understanding it before building it. Modeling-Designers build many kinds of models for various purposes before constructing things. Examples include architectural models to show customers, pencil sketches for composition of oil paintings, blueprints of machine parts, and outlines of books. Models serve several purposes. ■ Testing a physical entity before building it. ■ Communication with customers. ■ Visualization. ■ Reduction of complexity. Abstraction-Abstraction is the selective examination of certain aspects of a problem. The Three Models--
Class ModelThe class model describes the static structure of objects in a system—their identity, their relationships to other objects, their attributes, and their operations. The class model provides context for the state and interaction models. State ModelThe state model describes those aspects of objects concerned with time and the sequencing of operations—events that mark changes, states that define the context for events, and the organization of events and states. The state model captures control, the aspect of a system that describes the sequences of operations that occur, without regard for what the operations do, what they operate on, or how they are implemented.State diagrams express the state model. Interaction ModelThe interaction model describes interactions between objects—how individual objects collaborate to achieve the behavior of the system as a whole. Use cases, sequence diagrams, and activity diagrams document the interaction model. Relationship Among the Models-Each model describes one aspect of the system but contains references to the other models. The class model describes data structure on which the state and interaction models operate. The operations in the class model correspond to events and actions. The state model describes the control structure of objects. It shows decisions that depend on object values and causes actions that change object values and state. The interaction model focuses on the exchanges between objects and provides a holistic overview of the operation of a system. CHAPTER--3 Class Modeling A class model captures the static structure of a system by characterizing the objects in the system, the relationships between the objects, and the attributes and operations for each class of objects. The class model is the most important of the three models. Object and Class Concepts Objects-The purpose of class modeling is to describe objects. For example , Joe Smith. Simplex company, process number 7648 and the top window are objects. An object is a concept, abstraction, or thing with identity that has meaning for an application. Classes-An object is an instance of a class. A class describes a group of objects with the same properties (attributes), behavior (operations), kinds of relationships, and semantics. Person, company, process, and window are all classes. Class Diagrams-There are two kinds of models of structure—classes diagrams and object diagrams. Class diagrams provide a graphic notation for modeling classes and their relationships, thereby describing possible objects. Class diagrams are useful both for abstract modeling and for designing actual programs. An object diagram shows individual objects and their relationships. Figure 3.1 shows a class (left) and instances (right) described by it.
Values and Attributes-A value is a piece of data. An attribute is a named property of a class that describes a value held by each object of the class. Name, birthdate, and weight arc attributes of Person objects. Color, model Year, and weight are attributes of Car objects. Each attribute has a value for each object. Operations and Methods-An operation is a function or procedure that may be applied to or by objects in a class. Hire, fire, and payDividend are operations on class Company. Open, close, hide, and redisplay are operations on class Window. A method is the implementation of an operation for a class. For example, the class File may have an operation print. Links and Associations--A link is a physical or conceptual connection among objects. For example, Joe Smith Works-For Simplex company. A link is an instance of an association. An association is a description of a group of links with common structure and common semantics. For example ,a person WorksFor a company. Multiplicity--Multiplicity specifies the number of instances of one class that may relate to a single instance of an associated class. Multiplicity constrains the number of related objects. The UML specifies multiplicity with an interval, such as 1" (exactly one), "1...*" (one or more), or "3...5" (three to five, inclusive). The special symbol "*” is a shorthand notation that denotes "many" (zero or more).
Figure illustrates zero-or-one multiplicity. A workstation may have one of its windows designated as the console to receive general error messages. Association End Names--The name given to the association end. In the figure Person and Company participate in association WorksFor. A person is an employee with respect to a company; a company is an employer with respect to a person. Use of association end names is optional.