Вы находитесь на странице: 1из 3

Object Oriented Programming

Task 1
Object Oriented Programing concepts:
The purpose of the OOP program is to direct you to object-oriented programming, object-
oriented planning1

1. Object and class:


Object: An entity has state and behavior.
Class: A set of objects. It is a logical entity. A class must be dened before you can
create an instance (object) of the class.2
2. Inheritance: When an object is inherited from an attribute, the characteristics of the
parent object are inherited. This increases the reusability of the code. It is used to achieve
polymorphism at runtime. Inheritance is very powerful, and if it is used properly, we can
develop complex programs very efciently and elegantly.3
3. Polymorphism means the ability to have more than one form. An activity can have
different behavior in different cases. This behavior depends on the type of data to be used
in the operation. Polymorphism is used extensively in the implementation of inheritance.
The biggest advantage of polymorphism is created reusing code is by the programming,
once the classes are written, tested and implemented can easily use without paying
attention to what is written in the case.

Advantages of Object-Oriented Programming:


OOP helps the design, development and maintenance easier. This increases the efficiency
of the software development process.
OOP provides Data Hiding, which cannot be accessed arbitrarily from the outside.
OOP gives you the ability to simulate real-world events in a more efficient way. We can
provide the solution to the problems in the real world if we use object-oriented
programming.

1
Page 16, An Introduction to Object-Oriented Programming with Java
2
Page 17, An Introduction to Object-Oriented Programming with Java
3
Page 24, An Introduction to Object-Oriented Programming with Java
Limitations of Object-Oriented Programming:
OOP is a high-level concept, so it takes time to get used to it and apply it to the fullest.
Increase the burden on the developer OOP may encounter.
Solve problems using OOP method to consume more time than the time taken by
structured programming approach.

Task 2
Use-case diagram:
Class diagram:

Explain project:
Object Class:
o Object: The object described here is geometry.
o Class: Classes were list to represent objects as shapes.
Inheritance: Perimeter / area calculations are inherited from layers (triangle, circle, square, ...)

Polymorphism: from an area / perimeter calculation method, can be used to perform perimeter
/ area calculations of different shapes.

Вам также может понравиться