[Biojava-l] SequenceDBInstallation
Gerald Loeffler
Gerald.Loeffler@vienna.at
Wed, 05 Jul 2000 15:05:02 +0200
Hi all!
A few ideas and comments regarding the problem area factories/URNs/JNDI:
JNDI is definitely the preferred (read: J2EE-compliant) way of
discovering objects by their name. However, these objects must be
remote-enabled objects because JNDI is meant to be used as an interface
to a domain-wide directory service. This is a topic that we haven't
touched really yet - all BioJava-types (outside the CORBA regime) are
local and need to exist in one JVM to be able to co-operate (and this is
good - see below!).
There is no need to also make JNDI part of the API seen by the user of
BioJava. E.g., SequenceDBInstallation is a technology-neutral way of
getting SequenceDB-objects by name - it works whether it's
implementation requires a local SequenceDB object to exist (which
accesses a local flat file) or whether it's implementation locates an
RMI/IIOP-enabled remote object via JNDI.
Another word on distribution of objects: in Java, where remote-enabling
objects is so easy (using RMI (RMI/IIOP)) the temptation is to "just do
it". This usually leads to disastrous performance because fine-grained
objects (all of biojava-seq!) should not be remote-enabled! But's that's
an opulent topic...
cheers,
gerald
Matthew Pocock wrote:
>
> Gerald,
>
> Thanks for this code. Can I add it to org.biojava.bio.seq? I think that this is a short-tearm
> solution to a difficult problem, with things like URNs and JNDI being the more scalable &
> maintainable solution. But - KISS & all that - if SequenceDBInstallation works for you then I
> sudgest that we use it. To develop a URN scheim or implement JNDI will take more than 2 weeks - so
> it wouldn't make it into 1.0 anyhow.
>
> Matthew
>
> Gerald Loeffler wrote:
>
> > Hi!
> >
> > We need factories for SequenceDB objects and we need managers for
> > SequenceDB objects such that e.g. there is only exactly one SequenceDB
> > object that accesses the SwissProt flat file /data/sprot/sprot.dat.
> >
> > I attach 2 files: SequenceDBInstallation is an interface that defines
> > such a factory/manager for SequenceDB objects. It is very short and
> > documented rigorously, so please have a look at it for a more detailed
> > explanation why we need it. File StupidSequenceDBInstallation.java
> > contains an implementation of this interface for testing purposes.
> >
> > Once interface SequenceDBInstallation is in place and implemented
> > widely, we should be able to do things like this:
> >
> > SequenceDBInstallation inst = new SRSSequenceDBInstallation();
> > // or inst = new CorbaSequenceDBInstallation("bsa_naming_context");
> > // or inst = new FASTAFileSequenceDBInstallation("/data/sequences/");
> > SequenceDB sprot = inst.getSequenceDB("swissprot");
> > Sequence important = sprot.getSequence("FOO_DROME");
> >
> > what do you think?,
> > cheers,
> > gerald
> > --
> > Gerald.Loeffler@vienna.at _________________ Software Architect
> > http://www.imp.univie.ac.at ____ http://www.daemonstration.com
> > OOA&D, Java, J2EE, JSP, Servlets, JavaBeans, ODBMS, RDBMS, XML
> >
> > ------------------------------------------------------------------------
>
> --
> Joon: You're out of your tree
> Sam: It wasn't my tree
> (Benny & Joon)
--
Gerald.Loeffler@vienna.at _________________ Software Architect
http://www.imp.univie.ac.at ____ http://www.daemonstration.com
OOA&D, Java, J2EE, JSP, Servlets, JavaBeans, ODBMS, RDBMS, XML