Wanted: The perfect OOP application

Started by
16 comments, last by GameDev.net 19 years ago
Get the book "Agile software development: Principles, patterns and practices" by Robert C. Martin, it teaches good OOP design. In the book he does some great case-studys that you can learn alot from. And be sure to check out Object Mentor .

Edit: and oh, there are not such a thing as the perfect OOP application.

Lizard
Advertisement
Give me some time to put up the revised version of my app's source code, Sneftel.

I do not claim to be perfectly OOP, as I find generic programming to be far more powerful, but at the moment I'm using a component-based microkernel approach, where everything is a component. I'm still refactoring quite a bit from the current version, and I have a lot of code to go through.

I have made very few compromises in terms of design quality. If you want to know more, let me know, its going to be at least a week before its available on my site.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
Some time ago, a finnish game developer closed its offices and released the source code to an incomplete but playable 3D game with its engine named Cat Mother. One can clearly see that the developers must have used Java before and follow the strict, non-compromise OOP approach you described.

There are very few examples which really deserve to called clean, perfect code. Ogre for example is nice, intuitive and convenient, but imho not at all pure OOP - just slightly more OOP as the typical game developer wannabe is used to ;)

One piece of code that really surprised me was Mojavi, a PHP based framework for developing web applications (eg. a CMS). Not only is it very pure OOP, but it is very convenient and easy to use at the same time. I didn't know that kind of code quality is within the range of those hacky PHP coders :P

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Quote:Original post by Void
If the code involves win32 API, then it can't be made really OO :)

I'd agree that parts of the win32 API are definitely not OO.

In the past I have found that OO frameworks which wrap win32 windows non-OO functionality, like MFC (Microsoft Foundation Classes) and OWL (Object Windows Library Borland) are good examples of an OO alternative to non-OO code. Just compare a simple Win32 C app (e.g. scribble) with an equivalent C++ MFC or OWL app to get a good introductory appreciation of OO.
My take is that you will never be able to create a true OO application in C++, simply by the fact that you need int main() to start it.
Quote:Original post by Prototype
My take is that you will never be able to create a true OO application in C++, simply by the fact that you need int main() to start it.


OOP is essentially not a programming or an exact implementation strategy it actually more of a design issue.

Wikipedia has a quite nice article on it.

OOP is really language independant and can be expressed in mostly any programming language including asm and C.
HardDrop - hard link shell extension."Tread softly because you tread on my dreams" - Yeats
Quote:Original post by DigitalDelusion
OOP is essentially not a programming or an exact implementation strategy it actually more of a design issue.

Wikipedia has a quite nice article on it.

OOP is really language independant and can be expressed in mostly any programming language including asm and C.
Quote:Original post by Prototype
OOP is really language independant and can be expressed in mostly any programming language including asm and C.

Of course any turing complete language can mimic it, but I don't think that has anything to do with true OO programming. True OO should be forced upon you (not that I would favor that but you get the point). The mere fact that you have to call a function in C++ to create the primary object, seems inconsistent and therefore not 'truly' OO to me.

Surely this is just my private opinion as I don't feel particularly qualified to define standards :)
Not Languages are OO, People are!

This topic is closed to new replies.

Advertisement