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