Re: SoA Vs OO

From: Topmind (topmind_at_technologist.com)
Date: 06/05/04


Date: 4 Jun 2004 19:31:48 -0700


> Someone (as quoted by Topmind) wrote:
> > Why is OO good? It builds on well understood concepts from other
> > techniques: modularity and loose coupling between modules.
>
> Topmind replied:
> > Both these tend to be rather fuzzy concepts. One often finds
> > that there is no single one right way to group related things
> > because they often interact in multiple dimensions, and code
> > can only group (major) by one dimension at a time because text
> > is linear. Thus, the laws of physics prevent a single
> > one-size-fits-all grouping.
> >
> > One way around this is to factor more of the info into
> > a database and away from code so that we can get the
> > views we need for the circumstances at hand. Our view
> > then becomes virtual instead of hard-coded into text code.
> > OO fans don't like this approach for some still undefined
> > reason. They like their static, hard-wired code grouping.
>
> OO is not necessarily about text and is also a fuzzy concept, with no
> universally accepted definition. There are even OO systems that build
> on databases with muliple views just like you propose--if fact, it
> seems most Smalltalk systems are of that nature.
>
> The OO system I use for compiler writing (Yacc++) in fact explicitly
> has different forms of inheritance at different levels so that one can
> factor at multiple levels, since the factoring at different levels is
> likely to have a different hierarchical structure--that is one might
> have one hierarchy representing the parsing structure, another
> hierarchy representing the semantic structure, and a third hierarchy
> representing implementation details, each using seperate inheritance
> trees so that one can factor appropriately. As Topmind said,
> > We are not forced to find the One Right Perspective,
> > or the One Right Taxonomy because there is none.
>
> The interesting thing (in terms of your point) is that all of these
> separate hierarchies are expressed in text. Text itself is not the
> problem. In fact linearity is not the problem. It is established
> over and over again, that it is easy to write a transformation that
> takes muliple dimensions and maps them onto an ordering in one
> dimension, so that one can have the muplie views expressed in a linear
> representation--all one needs is the inverse ampping to extract the
> dimensions back out. As a result, C programers can cope with one
> dimensional arrays, and functional programmers love their Currying,
> and single inheritance language users can employ a pattern that
> effectively gives them multiple dispatch.
>
> Now, I have nothing against databases. Moreover, if your point is
> that easy accesses to multiple views is a good thing, I won't argue
> against that either. However, you will find that I tend to be rather
> strongly opinioned that most any system is better if somewhere,
> somehow one can conveniently translate the system into a linear
> textual representation, manipulate that text, and regenerate the
> modified non-linear model. That turns out to be a very powerful
> idiom.

But that is not what OO is about (although definitions are
all over the map). Anyhow, if you can treat
classes as data nodes, then you have a database of sorts,
which is closer to what I seek. However, it is a navigational
database, yet I think relational is more consistent,
disciplined, and generally superior to navigational.
Thus, if go that route, then do it right.

>
> Topmind's final point:
> > Things with hard-code structures like OO Visitor will be laughed off
> > the planet, and put into the Goto Pasta Museum.
>
> There is nothing wrong with the visitor pattern per se. In fact,
> there are many wonderful tools (e.g. JJtree and JTB) that will
> automatically generate the visitor pattern structure for one, and that
> coupled with separate inheritance hierarchies for different levels of
> abstraction is actually an excellent way of capturing some of those
> multiple dimensions.
>
> Finally, I think it is worth mentioning that "aspect oriented
> programming" seems directly focused on the concept of adding a
> dimension to a pre-existing programming structure that originally
> neglected it.

You may be interested in:

http://www.c2.com/cgi/wiki?CodeGenerationIsaDesignSmell

>
> Kind Regards,
> -Chris
>

Thanks for the feedback,
-T-



Relevant Pages

  • Re: SoA Vs OO
    ... > Someone (as quoted by Topmind) wrote: ... > factor at multiple levels, since the factoring at different levels is ... > hierarchy representing the semantic structure, ... > takes muliple dimensions and maps them onto an ordering in one ...
    (comp.object)
  • Re: SoA Vs OO
    ... Someone (as quoted by Topmind) wrote: ... > because they often interact in multiple dimensions, ... factor at multiple levels, since the factoring at different levels is ... hierarchy representing the semantic structure, ...
    (comp.object)
  • Re: SoA Vs OO
    ... Someone (as quoted by Topmind) wrote: ... > because they often interact in multiple dimensions, ... factor at multiple levels, since the factoring at different levels is ... hierarchy representing the semantic structure, ...
    (comp.programming)