[RT] Lifestyle contract

Stephen McConnell mcconnell at dpml.net
Sun Jan 23 15:37:24 EST 2005



> -----Original Message-----
> From: dev-dpml-bounces at lists.ibiblio.org
> [mailto:dev-dpml-bounces at lists.ibiblio.org]On Behalf Of Niclas Hedhman
> Sent: Monday, 24 January 2005 6:52 AM
> To: DPML Development
> Subject: Re: [RT] Lifestyle contract
>
>
> On Sunday 23 January 2005 20:11, Stephen McConnell wrote:
>
> > Lisa is a named and
> > identifiable service. Let's make the grossly sexist assumption that Lisa
> > can cook.  So the service would be to "cook up a meal", or "mix a
> > cocktail", or whatever.  If I select "singleton" = does this mean Lisa
> > cannot mix more than one cocktail at the same time? Or does it mean that
> > Lisa cannot mix and cook at the same time?  Or does it mean
> that Lisa can't
> > cook while she's drinking (or the inverse - can't drink while
> cooking)? All
> > of which should be taking into context - does Lisa have a license? Does
> > Lisa have to drive in order to cook?  If Lisa drives, is she
> still allowed
> > to cook? Is "allowed" a concept that is intrinsic to Lisa or is
> it imposed?
> >  Does Lisa have free will? Can Lisa drive, cook, and drink
> cocktails at the
> > same time?
>
> Are you drunk?
>
> > Ok - so who is Lisa anyway?
>
> My mother, can't you read the assembly...

I don't need to know that.

I (container) look at a deployment scenario and I need to know if "Mother"
is capable of handling herself as a singleton, or perhaps I (container) need
to wrap her up in a bit of thread level protection.  Thing is that the
container is conceded about the semantics that the "implementation assumes.
This is totally independent of the service provided.  I.e. why is this
potentially an assembler concern?

> > I think your mixing up the notion of identity with the implementation
> > strategy related to service delivery.
> >
> > Consider the following:
> >
> >   <component
> >      name="lisa"
> >      class="org.hedhman.family.Person"
> >      creation="singleton"
> >
> > In this context what does "singleton" imply?  Presumably it is
> an assertion
> > by an assembler that there is only one component that is
> representing Lisa.
> > OK - what does that mean and why is it valuable?
>
> No, Person is the Service. lisa is a component that only exist in
> a single
> instance (a.k.a singleton).
> In the given example, service Person is perhaps always a singleton.
>
> Take the statemachine as an example (since I am working on that
> right now). Is that a singleton or a transient component?

Not my (consumer) problem.

> That depends where it is used, not on how it is written.

Sounds like a broken component.
What is the service it provides.
Does it provide this service?
Yes/No?


> How it is written, defines its requirement and
> capabilities.

I don't want/need to know about implementation stuff.
How it is written is your business.
What it delivers is declared by the service interface.

OK - I think I'm heading toward the corner of violent disagreement.

:-)

Cheers, Steve.


>
>
> Cheers
> Niclas
>
> _______________________________________________
> dev-dpml mailing list
> dev-dpml at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/dev-dpml
>





More information about the dev-dpml mailing list