Re: SoA Vs OO
From: Chris F Clark (cfc_at_shell01.TheWorld.com)
Date: 06/04/04
- Next message: Vaidas Gasiunas: "Re: Is Modularity a Useful Concept?"
- Previous message: Phlip: "Re: Why is Hungarian Notation Considered Evil?"
- In reply to: Topmind: "Re: SoA Vs OO"
- Next in thread: Joachim Durchholz: "Re: SoA Vs OO"
- Reply: Joachim Durchholz: "Re: SoA Vs OO"
- Reply: Topmind: "Re: SoA Vs OO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 04 Jun 2004 11:04:52 -0400
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.
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.
Kind Regards,
-Chris
*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------
- Next message: Vaidas Gasiunas: "Re: Is Modularity a Useful Concept?"
- Previous message: Phlip: "Re: Why is Hungarian Notation Considered Evil?"
- In reply to: Topmind: "Re: SoA Vs OO"
- Next in thread: Joachim Durchholz: "Re: SoA Vs OO"
- Reply: Joachim Durchholz: "Re: SoA Vs OO"
- Reply: Topmind: "Re: SoA Vs OO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|