Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Private_Member_9643
Active Contributor
0 Kudos

Part I - “Introduction to Object Oriented Methodology”


Our start was as humble as it could possibly be… we could only manage a few simple BSP pages with ABAP code embedded in it. However, implementing complex BSP application using a similar approach is cumbersome. Looking at the quality of the finished product, we decided to move to “Object Oriented Approach” for implementing BSP Application.
From a developer’s perspective, an object-oriented approach is easy to implement as it involves less effort on integrity and consistency in between all the modules of an application. Such an approach also promotes scalability, modularity, a very high level of re-usability and many more non-functional requirements.

Object Oriented Methodology and BSP


What is Object Oriented Methodology?

What do you think of when you hear the word ‘CHAIR’? You probably imagine something made of wood, having four legs that support it, a seat to sit on, a backrest to allow a person to lean back, and may be, arm rests. Except for the arm rests, you would expect a chair to have all these attributes- you would not expect to see a chair without a seat! This conceptual model of a chair is a class. Using the conceptual model, you can now make a chair on you own if you were so inclined. If you did, the resulting chair would be an object. We define an object as ‘an instance of a class’. Therefore the difference between a class and an object in our analogy is that a class is the chair you imagined, and an object is the chair you made.

When we work with Object Oriented Programming the most common terms with which we always have to deal is Object and Class.

An Object is a tangible entity that may exhibit some well-defined behavior.

A Class is a set of attributes and behaviors shared by similar objects.

The Object-Oriented Programming model provides the following benefits to programmers:
  • Encapsulation – Encapsulation hides the implementation details of an object and thereby, hides its complexity.
  • Abstraction – Abstraction focuses on the essential characteristics of an object.
  • Inheritance – Inheritance creates a hierarchy of classes and helps in the reuse of the attributes and methods of a class.
  • Polymorphism – Polymorphism triggers different reactions in object in response to the same message.

If we consider the scenario which we discussed earlier, how would inheritance apply their? Assume that after having made a chair, you want a chair with wheels. To create a chair with wheels, you need to know what a wheelchair looks like and what it should be capable of doing (rolling on wheels!). In other words, you need to define a class called wheelchair. When you do this, you will find that all the attributes and behaviors of a chair are contained in a chair with wheels. In other words, it is a ‘kind of’ chair. This means that it would also have attributes and behaviors of its own- a unique attribute of a wheelchair is that it has wheels, and a unique behavior is that it can roll. How would this help in real life? You could take the chair you made earlier, add wheels to it, and have a chair with wheels. You would not need to build the chair from scratch and then add wheels to it.

What about encapsulation and abstraction? A well-made chair would show no evidence of the glue or nails that have been used to hold it together. All you would see would be four legs, a seat, and a backrest.

Advantages of Object Oriented Methodology

  • Realistic Modeling- Since we live in a world of objects, it logically follows that the object-oriented approach models the real world more accurately than the conventional, procedural approach.
  • Reusability- In the software industry, as in other industries, a large portion of time and energy is being spent in recreating the proverbial wheel. In the object-oriented approach, you build classes, which can then be used by several applications.
  • Resilience to change- Through the object-oriented approach, systems can be allowed to evolve. When a change is suggested, the old system need not to be completely abandoned and rebuilt from scratch. Resilience to change results in ease of maintenance. For the same reason, even during construction, parts of the system under development can be refined without any major change to other parts.

How does BSP realize Object oriented System?

BSP supports MVC design pattern. MVC is a time tested object oriented pattern that has been around for more than 5 years. How my approach is different? Simple answer for this is MVC supports Object Orientation, but Object Orientation doesn’t means that MVC pattern is the only solution for implementation of BSP Application in an Object Orientation way.

What is MVC?

MVC is a design pattern, used in BSP application to ensure an even clearer distinction between application logic and presentation logic.

Model, View and Controller are the three Objects which is used to implement BSP application using MVC pattern.

Controller takes the input from user. It determines the control flow, and update the application data accordingly using proper event handling mechanism.<<br>
Model is used to process data internally. It usually connects to business functionality.

View is used to represent output by visualizing the status from model and proceeds accordingly.

We already have good weblogs on MVC by Craig, but still we are lacking somewhere in the use of key concepts of Object Orientation for implementing BSP Application. So I will focus more on Key Concepts of Object Orientation and how we can utilize it in an efficient manner, by giving some real-time scenarios and examples.


8 Comments