Hi,
we are extensively using Jena's polymorhism, by implementing classes that
extend ResourceImpl, with such constructors:
public SomeImpl(Node n, EnhGraph g)
{
super(n, g);
}
This works nicely for polymorphic purposes, but it also means that we
cannot pass extra arguments that we would normally want in a constructor,
for example:
public SomeImpl(Node n, EnhGraph g, Client client)
{
super(n, g);
this.client = client;
}
Well we could of course add arguments to the constructor, but then in the
Implementation.wrap(), we wouldn't know where to get their values from.
To work around this, we've implemented setters such as
SomeImpl.setClient(Client)
instead. But it's not optimal, because this is the only place where we need
setters in an otherwise completely immutable code.
I hope I managed to explain my use case. Is there a way to achieve this?
Examples would be great.
Maybe I need to subclass Implementation to provide values to the
constructors?
Martynas