Re: Aspect Modelling and wide interfaces

From: Richard MacDonald <macdonaldrj_at_worldnet.att.net>
Date: Tue, 18 Jun 2002 03:40:19 GMT
Message-ID: <Xns9230E7A659379macdonaldrjworldneta_at_204.127.36.1>


Clifford Heath <cjh_nospam_at_managesoft.com> wrote in news:3D0D4C95.4C94E485_at_managesoft.com:

> Martin Fowler wrote:

>> A class with that many attributes is a bad smell. Often such classes
>> should be split into smaller classes.

>
> Sometimes I come across such classes, where the attributes and
> behaviours can easily be partitioned into functional groups. An
> example: in a library, the class "Book" has a number of separate
> facets (logical groups of features of a class, each supporting a set
> of related interactions. It has interactions with Asset management
> (purchase records, condition), with Borrowing, and with some other
> mostly orthogonal aspects. Existing languages allow these groups to
> be separated into different interfaces, which can reduce complexity in
> a meaningful way.

FWIW, this is a clear candidate for the Role pattern. I know you're talking about a different subject, but just so you know.  

> I use this insight as the underlying driver behind my thoughts about
> aspect orientation. The class exposes a facet to more than one aspect
> of the system, an aspect here being the group of facets that support
> some system role. I'm designing a data definition language called ADL
> (Aspect Definition Language) which properly supports facet isolation
> at a data modelling level.
>
> However, to map that to procedural constructs requires a complete
> rework of lifecycle concepts from typical O-O languages. I don't know
> of a language which provides support for isolating the implementation
> of facets of a single class though. An object may be constructed
> without all of its facets being "realised". A facet may then later be
> realised to an existing object. As I see it currently, this requires
> the RDB notion of key (attributes that form a unique identifier), but
> I'm still working with that.
>
> In any case, I'd like to know if anyone else is thinking down these
> lines. (Yes, I'm aware of www.aosd.net - not much of the work indexed
> there seems to attempt the things I'm after).

Probably the answer is yes, but you're being quite vague so I can't say for sure :-)  

Have you looked at COM? In all seriousness, it provides the Role patterns, unique identification of the "true instance", multiple "views" or interfaces at different times, some of which may never be "instantiated".

Personally, I would look to AOP when dealing with "internal" implementation consolidations, such as logging, persistence, etc. I would not look to AOP when dealing with multiple "facets" that a client could see. I'd rather handle the latter explicitly with a pattern, e.g., Role/ Mediator/ dynamic-multiple-inheritance. Received on Tue Jun 18 2002 - 05:40:19 CEST

Original text of this message