Re: Mixing OO and DB

From: topmind <topmind_at_technologist.com>
Date: Thu, 14 Feb 2008 16:01:20 -0800 (PST)
Message-ID: <a7566dfe-51d7-4f7b-bace-9ee3891f004b_at_i7g2000prf.googlegroups.com>


Tegiri Nenashi wrote:
> On Feb 7, 2:42�pm, topmind <topm..._at_technologist.com> wrote:
> > On Feb 7, 1:00�pm, Tegiri Nenashi <TegiriNena..._at_gmail.com> wrote:
> >
> >
> > > On Feb 7, 12:35 pm, Victor Porton <por..._at_narod.ru> wrote:
> >
> > > > I know both object oriented programming and DB (SQL). But it seems
> > > > that these are incompatible.
> >
> > > I suggest that OO ideas are too naive to continue influence
> > > programming. Formal Concept Analysis (FCA) is much more theoretically
> > > sound method how to organize things into taxonomies.
> >
> > > Here is an example -- a hierarchy of living things, restricted to the
> > > set {Lamprey, Trout, Lungfish, ..., Human}. FCA starts with feature
> > > matrix like this:
> >
> > > � � � � � � � � � �Jaws Limbs � Hair � �Lungs � Tail � �Shell
> > > Lamprey 0 � � � 0 � � � 0 � � � 0 � � � 1 � � � 0
> > > Trout � � � � � � � 1 � 0 � � � 0 � � � 0 � � � 1 � � � 0
> > > Lungfish � � � �1 � � � 0 � � � 0 � � � 1 � � � 1 � � � 0
> > > Turtle � � � � � � �1 � 1 � � � 0 � � � 1 � � � 1 � � � 1
> > > Cat � � � � � � � � 1 � 1 � � � 1 � � � 1 � � � 1 � � � 0
> > > Gorilla � � � � � � 1 � 1 � � � 1 � � � 1 � � � 0 � � � 0
> > > Human � � � � � � � 1 � 1 � � � 1 � � � 1 � � � 0 � � � 0
> >
> > > Then, the objects and the attributes (aka concepts) organize
> > > themselves into a lattice like this
> >
> > > Lamprey -> Trout -> Lungfish -> Cat -> Gorilla
> > > � � � � � � � � � � � �| � � � � |
> > > � � � � � � � � � � � �| � � � � ---> Human
> > > � � � � � � � � � � � �|
> > > � � � � � � � � � � � �----> Turtle
> >
> > > which is more powerful concept than OO hierarchy of classes. Each FCA
> > > concept is essentially a limited form of a relation.
> >
> > It should be pointed out that biological taxonomies are often not an
> > appropriate test of variations-on-a-theme management techniques for
> > many domains. This is because biology is based on descent-based
> > evolution; while other domain items, such as Apple Widgets are not,
>
> It has been observed that programming field started to resemble
> biology. There is clear evolution that governs the survival of the
> fittest. Also (for better or worse) the ever increasing complexity
> started to promote imprecise methods.

I partly agree, but in biology genes don't jump species very often (at least not for modern multi-cellular critters), while in computer code they can and do often.

But I meant more in terms of modeling the domain (business nouns), not modeling the internals of software. The differences in the business nouns are not reliably tree-shaped for the most part.

>
> > and are composed of a buffet-like mix-and-match of features based on
> > S. Job's whims.
>
> I'm not sure why St. John is relevant to the discussion. I just posted
> by deep impression about FCA method. You fill in the character feature
> matrix, and FCA method builds a hierarchy automatically for you.

Any set or graph can be forced into a tree if you try hard enough, but working with it in that forced form, especially with regard to change management, can be a pain because most changes are not "treefriendly".  You'd be refactoring (shuffling around) large branches too often. Sets are generally more forgiving.

Biology changes are generally funnelled into a tree-shape by the limits of reproduction. Constructs created by managers and marketers, on the other had, don't give a bleep about architectural purity or easy changes.

Even many OO'ers see the limits of pure trees, and construct more complicated OO structures (patterns) to better handle changes. However, these lose the conceptual simplicity of hierarchies, turning into a messy graph and one is stuck with a big ball of class pasta.

> The
> Galois duality between attributes and objects also provides an insight
> on the LSP confusion. An object has more than one set of properties
> subject to subset relation!

-T- Received on Fri Feb 15 2008 - 01:01:20 CET

Original text of this message