Friday, December 28, 2007

Object Oriented Programming Paradigm

My plan is to discuss object oriented design, how it is applied in .Net IDE, and further how it will apply to an internal software development team. Initial concepts for this overview are here.

Basically the OO technique describes a collection of cooperating objects. This is opposed by the older technique of writing an application as a group of sub-routines. Each object is capable of receiving messages, sending messages, and processing data. They should be viewed as independent machines with distinct roles and responsibilities.
The most basic form is the class. A class describes the abstract characteristics of an object (its properties and methods). Likewise, an object is an instance of a class (Lassie is an instance of the dog class).

Furthermore, there are three main pillars of thought which make up the OO paradigm: encapsulation, inheritance, and polymorphism.
  1. Encapsulation - Each object should define which members are publicly exposed to its clients. This concept is better described as an interface. The public interface should not need to know how the implementation is carried out, or when it changes. This interface should always remain static.
    • Modularity - This concept defines the separation of the interface and the implementation. Described more basically, the application, should be built of interacting parts.
  2. Inheritance - Sub-classes should be able to inherit or derive from parent classes. They should also have the ability to add or modify members of the parent class. This also enables the developer to write significantly less code.
    • Abstraction - further describes the concept of inheritance by modeling a complex problem set with a more simple collection of objects. A developer should be able to manipulate the appropriate level of inheritance for the given operation. For example, a driver only need to know how to turn the key to get the car started, they do not need to understand how the engine works, however, the mechanic may.
  3. Polymorphism - Defines the ability of the derived classes to modify the parent class. Polymorphism is accomplished through overriding or overloading members of the parent class.
An interesting common disconnect in OO design is the interaction with the relational database management system (RDBMS). There must be a conversion bridge (object - relational mapping) created between the two systems. In our applications, this is generally accomplished between the stored procedure and business tier of the application.

No comments: