Sunday 30 December 2018

Object Oriented Approach

The object-oriented approach helps to handle the complexity of the software development and also in the development of adaptable and extensible systems.
Software developed with the OO approach is composed of discrete objects interacting with each other to give rise to the overall (complex) behaviour of the system. Take a look at this diagram.



In C Programming we follow a structured/procedural approach wherein we have data declared in the form of variables and behaviour in the form of functions. We call a series of functions and every function call achieves a particular functionality. In this case, we are very much concerned about the functionality and not about the data.
 In object-oriented we take more real-world approach because data and functionality are not two different things. Actually, we have entities in the real world that perform some task (functionality) and we use attributes to describe those (data). (An entity is something that exists as itself, which might be tangible, intangible or conceptual.) For an example let’s assume a CAR as some real-world entity car moves so move() can be considered as performing some task or functionality and we can use a model name, colour, make, flue type etc. attributes to describe a car so that becomes data.

In object-oriented methodology we have multiple such entities that have their own functionalities and data (Attributes and behaviours), they interact (calls each other’s functions) with each other and the functionality is achieved.  These entities are called as objects in object-oriented terminologies.  

Thursday 27 December 2018

Need of Object Oriented Programming

What do we mean by; Java is object-oriented programming language (OOP). It Simply means java follows OOP paradigm. (What do you mean by paradigm? For the time being consider it as programming methodology/programming style) means you can also say java follows object-oriented style/methodology of programming.

 Before we get into the details of what this style is, let’s understand why OOP is required? Is there any other style/methodology available? Why java (Any other modern programming languages) follows OOP?
Before the invention of OOP, the software industry was facing certain concerns. Let’s understand some of the concerns first,

1) The software is capital investment. Mean once developed we expect long-term returns out of it with the lowest possible maintenance cost.

2) Complexity is inherent. Software’s are generally developed for automating the tasks which might be done manually otherwise.  As the software industry evolved expectations form the software’s went on increasing which made the development process more complicated.  Also in certain cases, the problem domain itself is very complicated. (Imagine railway reservation system i.e. irctc or banking)

3) Difficulty in team management. As the complexity is more it won’t be possible for an individual to develop software entirely. We need multiple developers (team) working on the same software. If the team is geographically dispersed, coordination and communication among the team members is difficult.

4) Impedance mismatch between user and developer. It refers to the misunderstanding between developer and end user during the phase of requirement gathering. No matter how much you try, the end product will never fulfil all the expectations of the end user in one go.

5) Software needs to be adaptable and extensible. End-user may change the requirements during the development process or towards the end of the development. software should adapt to these changing requirements. Also, the end user could come up with additional requirements after using the software for some time. Developers should be able to add those functionalities without disturbing the existing system.

                Complexity ultimately leads to maintenance. Being a capital investment large software systems cannot be scraped whenever the requirement changes. Planned or not the large systems tend to evolve every time. This condition is called “Software maintenance” It involves correction of errors, responding to the changing requirements and adding new features without disturbing the existing ones.

So to deal with these significant problems many programming paradigms (Programming styles/methodologies)  were developed or they already exist (Programming paradigm is the way how we approach software development process, ways of building the structure and elements of the computer program) some of them are,

        1) Imperative programming
        2) Functional Programming 
        3) Object-Oriented programming
        4) Logic programming
        5) Event-driven programming.

As OOP founds to be the best towards dealing with these concerns we need OOP and most of the modern programming languages follow OOP. 

To understand why and How OOP is best towards dealing these concerns learn OOP detail.

Object Oriented Approach

The object-oriented approach helps to handle the complexity of the software development and also in the development of adaptable and extens...