Peter: thanks for getting back;
what you say makes sense, can you please share some code links that demonstrate your approach? I still believe that ComponentFactory could be resurrected with "All these goodies" included - may be some other time :-) Andrei. -------- Original Message -------- Subject: Re: 112.2.4 Factory Component: "The service properties of the Component Factory service must not include the component properties" From: Peter Kriens <peter.kri...@aqute.biz> To: Andrei Pozolotin <andrei.pozolo...@gmail.com> Date: Sat 15 Sep 2012 06:41:32 AM CDT > The problems still contrived but I think I understand the point. The > thing is that I do not think this is the optimal approach to this > class of problems. The key rationale for services is that the provider > can offer an implementation of a contract (the service interface) > allowing the consumer of the contract to be completely oblivious of > the provider, linking the two dynamically when they are hosted in the > same system. > > For a given problem this connection should only be made once, however > in the blog the author wants to do the dynamic linking for each domain > object. In my experience, it is much better to register single > ShapeFactory service with createCircle, etc, than to try to > instantiate each shape separately. A few years ago I tried to come up > with a general model for this factory problem but in the end concluded > that registering a service that's a factory makes a lot more sense. > Suddenly you get all the type safety of the language and the > corresponding IDE support. All these goodies are absent when you have > to use the ComponentFactory. > > In the case of Vaadin the component factory makes sense to give you a > ShapeFactory because you need to maintain them by session, however, > there is no need I think to have that overhead for each shape. Once > you have a ShapeFactory bound to the session you're ok. > > Peter Kriens > > Sent from my iPad > > On 13 sep. 2012, at 17:01, Andrei Pozolotin > <andrei.pozolo...@gmail.com <mailto:andrei.pozolo...@gmail.com>> wrote: > >> *Peter:** >> * >> my "real world" problems are similar to this: >> http://floriansblog.wordpress.com/category/osgi-3/ >> >> thank you; >> >> Andrei >> >> >> -------- Original Message -------- >> Subject: Re: 112.2.4 Factory Component: "The service properties of >> the Component Factory service must not include the component properties" >> From: Peter Kriens <peter.kri...@aqute.biz> >> To: Andrei Pozolotin <andrei.pozolo...@gmail.com> >> Cc: bndtools-us...@googlegroups.com >> Date: Thu 13 Sep 2012 01:26:38 AM CDT >>> I have no idea what you try to achieve in the "real world"? Can you >>> give a practical concrete example/use case and show what you're >>> missing? I.e. you're currently complaining about lacking features, >>> not really the showing the concrete real world problem you're trying >>> to solve. My intuition is that you have a model in mind and want to >>> bend to the tool to your model instead of going with the flow ... >>> Have done this (too many times) myself and I can assure you it >>> usually does not work out :-) >>> >>> Kind regards, >>> >>> Peter Kriens >>> >>> On 12 sep. 2012, at 23:02, Andrei Pozolotin wrote: >>> >>>> *Peter:** >>>> * >>>> is it too late to have it changed, say via a property name space >>>> agreement: >>>> >>>> if a property looks like "factory.*" then it will be injected into >>>> the ComponentFactory properties; >>>> >>>> ? >>>> >>>> Thank you; >>>> >>>> Andrei >>>> >>>> -------- Original Message -------- >>>> Subject: Re: 112.2.4 Factory Component: "The service properties of >>>> the Component Factory service must not include the component >>>> properties" >>>> From: Peter Kriens <peter.kri...@aqute.biz> >>>> To: bndtools-us...@googlegroups.com >>>> Date: Tue 04 Sep 2012 01:25:12 AM CDT >>>>> If it included the service properties the factory would be >>>>> confused with the instances. The instances will have the service >>>>> properties (and parameter properties). >>>>> >>>>> I feel your pain but having them on both is potentially very >>>>> confusing. >>>>> >>>>> Kind regards, >>>>> >>>>> Peter Kriens >>>>> >>>>> >>>>> >>>>> On 3 sep. 2012, at 13:59, Andrei Pozolotin wrote: >>>>> >>>>>> *Peter*, hello >>>>>> >>>>>> 1) I have a factory component question, if I may: >>>>>> >>>>>> re : http://www.osgi.org/download/r4v42/r4.enterprise.pdf >>>>>> >>>>>> 112.2.4 Factory Component >>>>>> >>>>>> SCR must register a Component Factory service on behalf of >>>>>> the component as soon as the component factory is satisfied. >>>>>> The service properties must be: >>>>>> • component.name – The name of the component. >>>>>> • component.factory – The factory identifier. >>>>>> >>>>>> *The service properties of the Component Factory service must >>>>>> not include the component properties** >>>>>> * >>>>>> 2) why the decision "*must NOT include the component >>>>>> properties*" was made and can it be undone? >>>>>> >>>>>> I need these properties, and I do get them, but to get them, >>>>>> I need to jump through quite a few hoops, and I keep asking >>>>>> myself - why? :-) >>>>>> >>>>>> here is the specific example I want to have it in DS: >>>>>> https://gist.github.com/3608800 >>>>>> >>>>>> Thank you, >>>>>> >>>>>> Andrei >>>>>> >>>>> >>>> >>> >>
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev