More Object Oriented

Some time back I went back over a textbook I had from my Object Oriented Analysis and Design class. The book was authored by Grady Booch. The title of the book was Object-Oriented Analysis and Design with Applications. I have covered some ideas from this book in previous blog posts. This time I want to finish up some topics I read in the book.

A very popular term within the OO world is polymorphism. This means one name with many implementations. In other words, you have multiple related classes with the same function name. Then depending on the object upon which you are calling the method, you will get the right implementation executed.

There is another scenario where you have the same function name, but multiple implementations. This is where you have multiple functions within the same class that have the same name. However they are differentiated by the number and/or types of parameters that are passed in to the function. The official name for this behavior is overloading.

Another key idea in OO is that of aggregation. This is a big word to say that one object has another object or item as part of it. A synonym for this idea is containment. There are some lesser used OO topics that Booch mentions. One of them is that of a meta class, where the instances of the class are classes themselves. That does not sound familiar from my experience.

Some techniques for performing object oriented analysis and design are use cases and CRC cards. I have only hear about but never participated in CRC card analysis. Apparently you get together in a room and write down things on physical cards. I have done a lot of use case work in the past. However these days we skip that during out analysis phase. So do our requirements people.

Finally I read up on parametrized classes. These are classes whose behavior depends on parameters passed to the class. In C++, this idea is implemented as templates. I do have a little experience with templates in general. However I believe I want to beef up that experience.

Object Oriented

Some time ago I reread an Object Oriented Analysis and Design book by Grady Booch. It brought back a lot of memories from my first college class on OOA. So I thought I would talk about some more main topics from this book.

As far as programming languages go, the two ends of the spectrum are static binding and late binding. Most languages may one or the other. However a language may fall between the two extremes. Static binding is where variable types are fixed at compile time. It is also called early binding.

Dynamic binding is where variable types are not all known at compile type. This is also known as late binding. Having just completed an introductory class on Java, I now know that Java is a language with dynamic binding.

Why do object oriented modeling anyway? In theory, it encourages reuse of design. It also allows you to build upon components which are already tested and known good. Furthermore, some of the object oriented outlook feels nature to people. Evangelists say that Object Oriented Programming gives you great power. I am not so sure about that claim.

Let’s wrap up by defining some important terms in OOA. State is the properties of objects, along with the current value of those properties. A class defines a common structure and behavior for objects. And cardinality refers to the numeric relationship between classes. For example, a car has four wheels.

Next time I will go into big topics such as polymorphism and aggregation. Again this all seems very relevant as I just learn Java, which is an object oriented language.