Object Oriented
Abstraction, encapsulation, hierarchy, and polymorphism are fundamental principles in object-oriented programming. Abstraction helps simplify complex systems by focusing on essential information, while encapsulation manages data hiding. Hierarchy organizes abstractions into a structured system, enhancing problem-solving clarity. Polymorphism allows objects to exhibit different behaviors based on their class relationships, promoting flexibility and reusability. Understanding these principles is essential for effective software design and development.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Object Oriented Principles
Abstraction Encapsulation Hierachy Polymorphisma Abstraction is a good thing, but in all except the most trivial applications, we may find many more different abstractions than we can comprehend at one time. Encapsulation helps manage this complexity by hiding the inside view of our abstractions. Modularity helps also, by giving us a way to cluster logically related abstractions. Still, this is not enough. A set of abstractions often forms a hierarchy, and by identifying these hierarchies in our design, we greatly simplify our understanding of the problem. Polymorphism is a condition that exists when the features of dynamic typing and inheritance interact. Polymorphism represents a concept in type theory in which a single name (such as a variable declaration) may denote objects of many different classes that are related by some common superclass.
Abstraction An abstraction is a way to describe something where you only include the information about it that is important to you. An abstraction benefits you only in so far as it describes the information you need in order to solve a problem. So when you create an abstraction, you must first make certain that you know why you need it. own working definition representing something in the real world in a useful manner to solve a specific problem. Usefulness is measured by how well it helps you solve the problem you are trying to solve. My for creating an abstraction is:
Abstraction The representation make up a class. representation is an object. The rules that define the To make objects from classes, you must use the class definition like a template or a mold. Although each object may vary somewhat, all objects of the same class must conform to the class definition. That s why some people say that an object is an instance of a class. An object is created, manufactured, or instantiated (made real) from the class definition.
What an object knows Every object has to know two kinds of information and two types of behavior. First, you can say that an object knows about itself., there is information that describes the object, and would eventually be captured and manipulated in files or databases. Second, you can say that an object knows its own current condition. This condition is formally called the state of the object. Simply put, the state of an object is a description of the properties of the object during a particular period of time. Consequently, when any of the properties of the object change, the state of the object is said to change. An object can describe itself. An object knows its current condition (or state).
What an object knows Every object has to know two kinds of information and two types of behavior. What an object can do is easy to see when you re talking about animate objects. You ve discovered a two type of behavior. An object knows what it can do, for example an employee, to work, ask for time off, call in sick, complete a task, or accept an assignment. You would say that these are all things an employee type of object, and you would include these abilities in the object s description, for example, the Employee class. An object knows what can be done to it, for example a pencil, There are a lot of people who can write with the pencil every class of objects in this list would have to include a description of the write behavior. A better solution is to write one definition for the behavior in the pencil class everyone gets the same implementation of the behavior, and there is only one place to make changes.
Encapsulation Encapsulation provides the means to organize this information so that you can use it and maintain it efficiently. Here s what this organization looks like. First, encapsulation says you need to separate everything you know about the object into two categories: What you need to know in order to use the object you need to expose the interface of the object, What you need to know in order to make the object work properly you need to provide the mechanisms that respond to the interface. Giving an object purpose You need to know why that type of object exists, what it was designed for. The interface is designed to satisfy the purpose.
In order to make the object work properly, you need to place inside the object: The implementations for each interface The data that describes the structure of the object The data that describes the current state of the object
Polymorphism Polymorphism means the ability to take on many forms. The term is applied both to objects and to operations. There are two kind of polymorphism : One Operation, Many Methods A polymorphic operation is one whose method may take on many forms based on the class of the object carrying it. One Interface, Many Implementations Polymorphism means one interface, many possible implementations. Cars, for example, are designed with polymorphism in mind. They all use the same interface.
Strengths of Object Orientation A single paradigm Single language used by users, analysts, designers, implementers Facilitates architectural and code reuse Models more closely reflect the real world More accurately describe corporate data and processes Decomposed based on natural partitioning Easier to understand and maintain Stability A small change in requirements does not mean massive changes in the system under development