Hi dear Michael
thanks for sharing ur ideas and code with me, i really appreciate it

actually , i have my own working code , implemented with the standard
patterns , but i consider this a work around , much like i think ur code
is,u r working around the problem  , i think that this is not the natural
way of doing things , u have a double indirection , an interface thet return
another interface which contain the component ,WHY??? why not making it an
interface and any component can implement it and can b used as an item,why
restrict me to inlining my markup or have some unnecessary level of nesting
eg: item.add(new Panel(...));
is this the natural way of doing it? in my opinion No , it is by overriding
newItem method or newItemFactory method

my real problem is not making something work, no , i have a working code
but i am talking about different thing here , it is about HOW thing
naturally work in an OO fashion , without any unnecessary nesting
nesting involve making the reusable MasterDetailPanel and its component
authers agree on string is which is error prone

thanks
joe


On Fri, May 22, 2009 at 11:12 AM, Michael Mosmann <[email protected]>wrote:

> Am Freitag, den 22.05.2009, 09:11 +0300 schrieb Joe Fawzy:
> > Hi allthanks for ur attention
> >  my code is like
>
> > and as i said if there is another way, i still think it's better to
> program
> > to an interface
>
> i am not sure, if i understand your problem.. but i did something like
> this in an (IMHO) similar case..
>
> interface FactoryResult
> {
>  public Component getComponent();
> }
>
> interface Factory
> {
>  public FactoryResult getSomething(String id, SomeData data);
> }
>
> ... so then you can do
>
> populateItem(ListItem item)
> {
>  result=factory.getSomething("id",item.getModelObject());
>  item.add(result.getComponent());
> }
>
> .. maybe this will help.
>
> michael mosmann
>
>
>

Reply via email to