Need of object oriented programming
An important part of programming is handling complexity. The first step was moving from raw machine code to assembler. Then high-level languages, where the instructions in the language were closer to the programmer's way of thinking. In particular, almost all high level languages have some way of packaging blocks of instructions into subroutines, procedures, functions. When a programmer writes a function, what that function does is like a "super-instruction", and is even closer to what the programmer is thinking when writing the program.
The following are resons to use object-oriented programming:
1) Object-oriented programming provides a clear modular structure for all type of programs
2) Object-oriented programming makes it easier to maintain and modify current existing code
3) Object-oriented programming provides a good framework and platform for code libraries where the supplies of software components can be easily adapted and modified by the programmer.
4) Code reusability
5) It is suitable for real problems and real world tasks
Need for object oriented programming
There are various things here we need for object-oriented programming:
Security (called abstraction), sharing (called inheritance),easy to maintain, modularity, controlling data accessibility (called access specifier), readability, achieving individual teamwork (in software companies), easy to document in the analysis stage, last but not the least is a strong community.
An efficient way to use the OOP paradigm:
High cohesion (the calmness of the code will clearly state what its actual function is), Low coupling (depends on other module)
Object Oriented Development
Object-oriented development is a conceptual process that is independent of the programming language until the last stage. Object oriented development is fundamentally a way of thinking and not a programming technique. Its biggest benefit comes from helping specifications, developers and customers to clearly understand abstract concepts and communicate them to each other. It can serve as a medium for specification, analysis, documentation and interfacing as well as programming.
Object Oriented Model
The three types of models to describe a system from different perspectives: Class models for the objects in the system and their relationships; State models for the life history of objects, and Interaction models for interactions between objects. Each model is applicable during all stages of development and gains expansion as development progresses. A complete description of a system requires models from all three perspectives.
The class model describes the static structure of objects and their relationships in a system. The class model defines the universe of discourse in the context of software development. Class models contain class diagrams. A class diagram is a graph whose nodes are squares and whose arcs are relationships between classes.
The State model describes those aspects of an object that change over time. State model Specifies and implements controls with state diagrams. A State diagram is a graph whose Nodes are states and whose fields are transitions between states due to events.
The Interaction model describes how objects in a system collaborate to achieve comprehensive results. The Interaction model starts with use cases that are expanded with Sequence and activity diagram. A use case focuses on the functionality of a system that is What does a system do for users. A sequence diagram shows the objects that interact and Time sequence of their conversation. An activity diagram detailing important processing Step.
These three models are separate parts of the description of a complete system but are cross-linked. The class model is the most fundamental, as it is necessary to describe what is changing or changing before describing when or how it changes.
Features of Object Oriented Model
You have already know about several features of object oriented model some of them are as follows-
1. Abstraction
2. Encapsulation
3. Combining Data and Behaviour
4. Sharing
5. Emphasis on the Essense of an Object
6. Synergy
Abstraction
Abstraction lets you 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. Use of abstraction preserves the freedom to make decisions as long as possible by avoiding prema ture commitments to details. Most modern languages provide data abstraction, but inherit ance and polymorphism add power. The ability to abstract is probably the most important skill required for Object Oriented development
Encapsulation
Encapsulation (also called 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. Encapsulation prevents portions of a program from becoming so interdepen dent that a small change has massive ripple effects.
Combining Data and Behavior
The caller of an operation need not consider how many implementations exist. Operator polymorphism shifts the burden of deciding what implementation to use from the calling code to the class hierarchy. For example, non-Object Oriented code to display the contents of a window must distinguish the type of each figure, such as polygon, circle, or text, and call the appro priate procedure to display it.
Sharing
Object Oriented techniques promote sharing at different levels. Inheritance of both data structure and be havior lets subclasses share common code. This sharing via inheritance is one of the main advantages of Object Oriented languages. More important than the savings in code is the conceptual clar ity from recognizing that different operations are all really the same thing. This reduces the number of distinct cases that you must understand and analyze.
Emphasis on the Essence of an Object
Object Oriented 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. As require ments evolve, the features supplied by an object are much more stable than the ways it is used, bence software systems built on object structure are more stable in the long run. Object Oriented development places a greater emphasis on data structure and a lesser emphasis on procedure structure than functional-decomposition methodologies. In this respect, Object Oriented development is similar to information modeling techniques used in database design, although Object Oriented develop ment adds the concept of class-dependent behavior.
Synergy
Identity, classification, polymorphism, and inheritance characterize Object Oriented languages. Each of these concepts can be used in isolation, but together they complement each other synergistically.
0 Comments