× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



From: Walden H. Leverich

It's been our experience that creating sub-classes for business objects
is a waste of time.

We call this the San Francisco Syndrome, named after the ill-fated project
of the same name.


Object inheritance* can make a ton of sense when
dealing with runtime objects (strings, commands, connections, etc.) but
tends to make less sense with database objects.

The OO people get all frothy when I say this, but inheritance really works
best for static solution-set problems, things where the rules are clearly
stated and don't change often. Formatting HTML is a perfect use of
inheritance because every tag is a tag, and every input tag inherits the
base tag features and every button inherits the base input tag features.


Then you can have a method on AddressableObject called GetAddress()
which returns an address. Vendor may override GetAddress() to look in
the VendorAddress table, and Customer may override it to look in the
CustomerAddress table and Contact may override it to look in the
ContactAddress table, but it's still the "GetAddress()" method.

Yeah, the line between inherited functions and shared functions is pretty
blurry. And if you don't have multiple inheritance, then you need to use
interfaces. And interfaces have their own problems, namely the fact that
you can't define any code in an interface, so unless you want to code the
same things over and over in every class, interfaces don't buy you a lot.


*don't get me started on multiple inheritance, does Java even support
it? I know .Net does NOT

C++ supports multiple inheritance, Java does not. And in order to get
around the issue, some clever (and I mean that term with all the disdain I
can muster) have come up with "aspect-oriented programming", in which things
that are too messy for inheritance and too complex for interfaces are
actually "injected" into the code by a post-processing system.

That's actually an over-simplification of the aspect model, but in my mind
it simply underscores the fact that the basic idea of programming is getting
lost in a flood of technology.

Joe


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.