This world is made up off several objects and objects communicate with each other. Similar objects can be grouped together. For example, take a college. It can have two working sections like teaching and non-teaching. These two groups can be further sub divided.
We can also group the people in a college into several departments. Generally a college will have several lecturers in each department. A college can have one or more laboratories and there might be separate lab technicians to assist in conducting practical. A college will have a Principal for managing the entire college. Each department might have its own head who is responsible for managing their own department. Like this the entire world can be viewed as a collection of objects that communicate with each other to perform activities.
This theory of objects can be applied to software to solve complex problems.
Disadvantages of Conventional Programming
Traditional programming languages like COBOL, FORTRAN etc are known as procedural languages. In these languages the program is written as a set of statements which contains the logic and control that instructs the compiler or interpreter how to perform a certain task. It becomes difficult to manage the code when the program is quite large.
To reduce complexity, functions or modules were introduced which divides a large program into a set of cohesive units. Each unit is called a function and each function can call other functions as shown below:
Even though functions reduces complexity, with a lot of functions sharing a common set of global data may lead to logical errors.
Following are the disadvantages of procedural or structured languages:
- Programs are divided into a set of functions which can share data. Hence, no data security.
- Focus is on the code to perform the task but not on the data needed.
- Data is shared globally by several functions which might lead to logical errors.
- No restrictions on which functions can share the global data.