[Chicago-talk] super complex object

JT Smith jt at plainblack.com
Tue Aug 2 07:38:57 PDT 2005


> What is the things really supposed to do?

This is the base class of an application object. Everything that can be seperated out, 
has been (users, groups, sessions, filesystem access, database access, caching, and 
about a hundred other things). However, there are three core functions that each 
application object must have, and this base class contains them.

They are:

Privileges: there are 8 methods dealing with this.

The relationship of one object to another: there are 27 methods dealing with this, as 
you might have guessed, the relationships themselves are complex. It is not a 2d 
relationship

The relationship of an object to a URL on a website somewhere: there are 5 methods 
dealing with this.

In addition there are some "meta" responsibilities each application object must have 
available to it. For instance, there are methods to version the property data, there are 
methods to import and export the property data. These things must be contained in the 
object, because only the object knows what properties there are, and how to deal with 
them. The list goes on here too, as there are 8 other functional groupings of meta 
responsibilities on the object.

I'm sure there were other ways to do this, but as I said before two requirements 
outweighed everything else by quite a bit. First was the need for subclass developers to 
have to write as little code as possible. Second was the need for speed. Also, 
redesigning the object at this point is not possible, because there are hundreds of 
subclasses already in existence, so any changes cannot alter the API at all.

I know I can take the functional groupings of the "meta" functions and create classes 
out of them and then do multiple inheritance to get their methods into the base object, 
but there are three problems with that. The first is that it increases the size object 
tree, which slows down the application. The second is that no matter what I do, those 
objects cannot ever function independently, because they need to know too much about the 
data they manipulate. And third, some of the meta functions, like versioning, influences 
everything else, and therefore cannot truely be completely factored out of everything 
else.

Anyway, I hope that explains a little bit further the problem. Thanks for listening.


JT ~ Plain Black
ph: 703-286-2525 ext. 810
fax: 312-264-5382
http://www.plainblack.com

I reject your reality, and substitute my own. ~ Adam Savage


More information about the Chicago-talk mailing list