Berin Loritsch wrote:
>>From: Nicola Ken Barozzi [mailto:[EMAIL PROTECTED]] 
>>
>><attention mode="heretic">
>>Component interface as a teg interface is useless and in some 
>>cases bad 
>>for reasons already expressed.
>>But maybe we could make an abstrace SafeService that can act 
>>as a base 
>>class to extend to make a Service that can be created only by a 
>>Container: private method, creator method and check of proper 
>>order of 
>>interface calling.
>></attention>
> 
> What you are proposing would *require* a minimal definition of
> a container in framework. 

Nope, an abstract component that does checking.
And it's not a requirement, but a utility class that can help create 
more errorproof components.

 >  A generic container cannot access
> private members of components unless it is a class enclosed
> in itself.  Furthermore, a generic container cannot access
> protected members (including constructors) unless they are in
> the same package.

Of course, it needs a "creator method" (see above).
If we call it (wild try)

   static Object createForContainer()

it would not make users just think that new() can make things work.

Also, it would have empty implementations of, let's say, Inititalizable 
and Startable.

And have:

  public void start()
  {
    if(initialized)throw new HeyManWhatAreYouDoingException();
  }

  public void initialize()
  {
    set initialized = true;
  }


> It's just not feasible.
> 
> 
>>This is an implementation detail.
>>Or you do Role,SubRole or "role/subrole".
>>It's not a problem, but semantically there is a point in 
>>defining role 
>>and subrole.
> 
> In essence what the CM as I have defined it would do.  Just
> change the Object for String, and the name hint for subrole,
> and viola' you have what you are looking for.

Yes, I'm backing your calim that we need a secong role thing.

What I'm trying to show is that complying with hints was in fact 
compulsory, not just a hint, hence the sub-role definition.

The connection-sslconnection example is exemplary.

Connection role says I want to talk.

PlainConnection
SSLConnection

are different sub-roles

MYPlainConnection1
YourPlainConnection2
MYSSLConnection
TomcatSSLConnection

are different implementations.

I would want just to talk, so I would need only one implementation, I 
don't care which.

If I need an SSL connection, I would also ask for a subrole.

Discerning between concrete implementations, instead, has to be done by 
the container.

-- 
Nicola Ken Barozzi                   [EMAIL PROTECTED]
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to