Professional Documents
Culture Documents
Oops Concepts, Class Harsha
Oops Concepts, Class Harsha
OOPS- Encapsulation
Group of Attributes and Methods (Functional Components) , binding together into a package.
Class
What is a Class?
Class is executable and it takes a specific input to process the business transaction and it generates a
specific out put as a result.
Classes are created inside an Application. Below diagram shows the same.
We create an application
We create classes inside an application
We create functionalities inside classes.
Done.
Types of Classes
There are two types of classes.
Concrete Class :
Define the functionalities + Initiate transaction by executing functionalities + Generates a
transaction ID + the transactions gets closed here.
We can reuse the functionalities.
Abstract Class : Define the functionalities + We can reuse the functionalities.
1. Concrete Class: A Concrete class is the one , where we can Initiate business transactions and
process it.
2. Abstract Class : An abstract class is the one, where we CANNOT initiate business transactions.
For example.
1. Insurance (Concrete)
2. Loan (Concrete)
3. Verification. (abstract)
We can initiate Insurance and Loan transactions at the appropriate concrete classes of
“Insurance” / “Loan” respectively.
But we CANNOT initiate above transaction at “Verification” class, because it’s an abstract class.
Inheritance
Its is the process of accessing the attributes and functionalities of one class into another class.
Here at least two classes will be involved. One of the two classes acts as parent class and the other one
acts as child class.
For example in a banking project. If we have the classes like Loan, Insurance, Accounts, Verification and
Finance.
Class Verification
Attributes + Functionalities;
Attributes + Functionalities;
This class can access the functionalities of Verification class as this is inheriting from Verification
Class.
Attributes + Functionalities;
This class can access the functionalities of Verification class as this is inheriting from Verification
Class.
}
Class Insurance Inherits from Verification
Attributes + Functionalities;
This class can access the functionalities of Verification class as this is inheriting from Verification
Class.
In the above example Verification class is Parent class, where as the loan, accounts and insurance classes
are child classes.
Also, one more thing we can observe is, verification class can be an abstract class and which supplies a
common features to all below concrete classes.
DONE.