Tuesday, September 28, 2004

Object oriented programming - What is Fragility?

In my experience, I heard a lot of time about a software application getting developed and being called fragile after a period of time.

What is fragility of a software application in context of object oriented programming?

As you could make out by now that in object oriented programming, a software application is made of various classes. If you are working in Java programming language, then, these classes are grouped in packages appropriately after due consideration of dependency on other classes.

So, when does a software application while getting developed become fragile?

When a little change in one of the class tends to break the software at several places. When, making change is associated with breaking of software at several other places which one sometime remains unaware of. Such software applications are result of bad object oriented design and analysis, and hence, bad object oriented programming.


Monday, September 27, 2004

Object oriented programming - Example 1 & Some definitions

Object oriented programming provides world of flexibility in programming when you are out to program a complex large application. Its essence lies in its ability to provide a software application to be easily maintainable, scalable, extensible, robust.

Easily maintainable aspect of a software application is of interest. What if a user of your application ask for enhancement to include new car type in a car application. The software vendor should be easily able to enhance the exiting product and deliver the package related to that enhancement. The vendor also must ensure that the enhancement in no way break the software. Also, enhancement does not ask for much change. Also, enhancement does not require one to deliver the entire software release, but just a patch release of probably a software package.

All this brings into one's attention of the need of making a software application taking care of the following aspects of object oriented programming:
  • Rigidity
  • Fragility
  • Immobility
  • Viscosity

A good object oriented design must ensure that above factors have been given due attention.

This requires the designer to have deep understanding of basics of object oriented programming that includes following:

  • Class (Abstract class and concrete class)
  • Object
  • Message
  • Interface
  • Inheritance
  • Polymorphism

Friday, September 24, 2004

Object oriented programming - Example 1 continued...

Ok, So, there could be following questions that one auditor for school could be interested in knowing.
How many teachers are there in St. Thomas school?
How many students are there in St. Thomas school?

Well, the same auditor could be sent to some college. So, he would be interested in knowing following:

how many teachers (including professors, associate professors, lecturers ) are there in JNTU, college?
How many students are there in JNTU college?

What are we approaching towards?

Did you observe some pattern?

1. Educational institution such as School/College
2. Teachers who could be professor, associate professor, lecturer
3. Student

I am eager to say that we have come down to three imprtant classes. They are following:
1. EducationalInstitution
2. Teacher
3. Student

There are following inheritance relationships:
School, college inheriting from EducationalInstitution
Professor, associate professor, lecturer inheriting from Teacher

Base classes: EducationalInstitution, Teacher, Student

Whethar they should be abstract would be discussed a bit later.

The beauty of object oriented programming lies in the fact that it makes the problem really scalable, extensible and easily maintainable.

Tuesday, September 21, 2004

Object oriented programming - Example 1

I was talking about the statement, Jane is a student of the school, St. Thomas. It could be clearly seen that we are talking about two classes Student and School. What is the relationship between? In general sense, a student studies in a school. We could as well say, a school has one or more student studying in it.

How about saying this statement?

Mary is a teacher in school, St. Thomas. Thus, we could see that Teacher is another class. Now, what is the relationship between the teacher and the school. The school has one or more teacher.

So, finally we could say the following:
The school has one or more teacher.
The school has one or more student.

We have three different types or classes. They are as following:
School
Teacher
Student

One could be interested in knowing the teachers' count in the school. The same holds true for students' count.

Like following question:

How many teachers are there in St. Thomas school?
How many students are there in St. Thomas school?

Let me pause for a while. I used several times the word, CLASS? What is the term Class in object oriented programming?

Class is one of the most significant thing in object oriented programming. Class is one of the most important building block of Object oriented paradigm.

Monday, September 20, 2004

Object oriented programming - The beginning

After giving a thought over object oriented programming, I found that it has lot of usability. It cracks down a problem into a great solution where I could have total control on various issues such as scalability, reliability, robustness, ease of maintenance.

Looks like I am going gaga over object oriented programming. Let me start talking some reall stuff.

Let me throw a statement that you might have come across at some point of your life.

Jane is a student of school, St. Thomas.

There are two proper nouns in above statement. They are Jane and St. Thomas. And, there are two common nouns, student and school. Common noun is use to refer to person,place or thing in a general sense.

Going by proper nouns and common nouns, we could say, the following:

Jane is of type Student, or Jane belongs to the category Student, or, Jane belongs to class Student.
St. Thomas is of type School, or St. Thomas belongs to category School, or, St. Thomas belongs to class School.

Am I making that the statement "Jane is a student of school, St. Thomas." depicts two classes? They are Student and School. Am I saying that Jane is an object of type Student, AND, St. Thomas is an object of type School.

To summarize:
Jane is a student of school, St. Thomas gives following:

Class: School, Student

Is there any relationship between School and Student?

Sunday, September 19, 2004

Object oriented programming - Solving a real world problem

I, myself, had worked a lot on procedural programming in the start of my career. And, it was pretty easy for me to continue working so. Then, I was bugged by this object-oriented paradigm.

Trust me, at the first instance, all I thought is object oriented programming... why? Why in the first place should people go to a new paradigm when we already have procedural programming in place? Why is there so much noise about object oriented programming? Why companies have started looking for solutions that come out of object oriented analysis and design? There were so many whys. :)

And, I gave it up! C'mon, I am not going to learn this object oriented programming from scratch. Why waste time?

But, tell you all, today, I feel, it was worth spending some time to learn and implement object oriented programming. Today, I just feel why one stick to procedural programming. The only answer I get is probably procedural programming is good for solving small problems. If you are looking for solving big and complex real world problems, it is much cooler to use object oriented programming. Object oriented programming provides total control.

Object oriented programming - A cooler experience

Object oriented programming includes object oriented analysis and design. After all the attempts to learn object oriented programming, I understood that one could learn and master OOPs ( Short for object oriented programming ) only by thinking in object oriented manner.

I shall be presenting my experience my cooler experience with object oriented programming in a very simple manner. Trust me, I took some time from shifting my thinking from procedural programming to object oriented programming. But now that I could make sense out of OOPs, I love it. Watch out for a cool object oriented programming world!

Trust me, OOPs is amazing.