The document discusses the basics of object oriented programming (OOP). It defines OOP as a programming paradigm that models applications as a group of related objects that interact with each other. The key components of OOP discussed are encapsulation, inheritance, polymorphism, classes and objects. It also describes how OOP can be used for user interface design by modeling the interface as interacting objects based on user requirements analysis and use cases.
The document discusses the basics of object oriented programming (OOP). It defines OOP as a programming paradigm that models applications as a group of related objects that interact with each other. The key components of OOP discussed are encapsulation, inheritance, polymorphism, classes and objects. It also describes how OOP can be used for user interface design by modeling the interface as interacting objects based on user requirements analysis and use cases.
Oriented Programming Paradigm (OOPP) Lesson Objective 01 Learn about the basics of object oriented programming
s: Know the different components of OOP such as
02 data encapsulation, inheritance and polymorphism
Understand the use of OOP in relation to
03 the user interface design of a software The Object Oriented programming paradigm plays an important role in human computer interface. It has different components that takes real world objects and performs actions on them, making live interactions between man and the machine. Following are the components of OOPP: Object Oriented Programming This paradigm describes a real-life system where interactions are among real objects Paradigm It models applications as a group of related (OOPP): objects that interact with each other
The programming entity is modeled as a class
that signifies the collection of related real world objects Programming starts with the concept of real world objects and classes Object Oriented Programming Application is divided into numerous Paradigm packages
(OOPP): A package is a collection of classes
A class is an encapsulated group of
similar real world objects Objects Real-world objects share two characteristics − They all have state and behavior. Let us see the following pictorial example to understand Objects. In the above diagram, the object ‘Dog’ has both state and behavior. An object stores its information in attributes and discloses its behavior through methods. Let us now discuss in brief the different components of object oriented programming. Data Encapsulation Hiding the implementation details of the class from the user through an object’s methods is known as data encapsulation. In object oriented programming, it binds the code and the data together and keeps them safe from outside interference. On the example from the previous page, encapsulation principle means that we should add to the same class behavioral methods (drive, stop, etc.). Those may be used in our application and also to provide restricted access to changes in class instance’s state. We don’t want a client of our class to be able to turn off the car and then still be able to set its speed value to 100 miles per hour. Public Interface The point where the software entities interact with each other either in a single computer or in a network is known as pubic interface. This help in data security. Other objects can change the state of an object in an interaction by using only those methods that are exposed to the outer world through a public interface. Class A class is a group of objects that has mutual methods. It can be considered as the blueprint using which objects are created. Classes being passive do not communicate with each other but are used to instantiate objects that interact with each other. This figure shows an example of a class. The animal class can be composed of different subclasses such as dog class, cat class and cow class. This shows us that a class is like a blueprint for an object. Inheritance Inheritance as in general terms is the process of acquiring properties. In OOP one object inherit the properties of another object. Inheritance is one of the most important features of Object- Oriented Programming: Sub Class: The class that inherits properties from another class is called Sub class or Derived Class. Super Class: The class whose properties are inherited by sub class is called Base Class or Super class. Inheritance Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. By doing this, we are reusing the fields and methods of the existing class. Example: Dog, Cat, Cow can be Derived Class of Animal Base Class Polymorphism The word polymorphism means having many forms. Polymorphism is the process of using same method name by multiple classes and redefines methods for the derived classes. In simple words, we can define polymorphism as the ability of a message to be displayed in more than one form. A person at the same time can have different characteristic. Like a man at the same time is a father, a husband, an employee. So the same person possesses different behavior in different situations. This is called polymorphism. Object Oriented Modeling of User Interface Design Object oriented interface unites users with the real world manipulating software objects for designing purpose. Let us see the diagram. Interface design strive to make successful accomplishment of user’s goals with the help of interaction tasks and manipulation. While creating the OOM for interface design, first of all analysis of user requirements is done. The design specifies the structure and components required for each dialogue. After that, interfaces are developed and tested against the Use Case. Example − Personal banking application. Object Oriented Modeling of User Interface Design The sequence of processes documented for every Use Case are then analyzed for key objects. This results into an object model. Key objects are called analysis objects and any diagram showing relationships between these objects is called object diagram.