On 8 May 2005, at 21:43, Reto Bachmann-Gmuer wrote:
back home and looking at the code: could you give me a hint on how to
get the instances of AtomContent given a com.sun.labs.tools.blog.Blog or
org.openrdf.model.Graph (I was looking at the SesameRDFFactory).
Well you can get all instances of a particular class in the database by using the
SesameRDFFactory.getAllObjects(AtomContent.class)
This gets set up in the Blog class. Currently I find it is best to make sure all
the classes are set up in the database with a call similar to Blog.initFactory().
a good example is the Blog.getEntries() method.
There is still a lot of clean up to do in this SesameRDFFactory class. I have let it
grow up till now so that it would fit my needs. But I have some good ideas on how to
clean it up.
As you see I have a whole bunch of implementations of my interfaces such as AContent,
which I use to create objects and testing them for coherence before adding them to the
database. Clearly one could just as well create them as dynamic proxies. But when I
started writing this I was not sure if that would give me all I needed.
I don't believe anymore that one should return classes with more interfaces implemented
that what the class returns. I think instead that there should perhaps be a RDFFActory
cast() method that returns an object with extra interfaces implemented. Though I am still
not sure about this.
Henry
thanks! reto