Technologies
It is fairly easy to work with the server without understanding all of
its layers. The API is clearly outlined in the ome.api package and the
client proxies work almost as if the calls were being made from within
the same virtual machine. The only current caveat is that objects
returned between two different calls will not be referentially (i.e.
obj1 == obj2) equivalent. We are working on removing this restriction.
To understand the full technology stack, however, there are several
concepts which are of importance:
- A layered architecture ensures that components only “talk to” the
minimum necessary number of other components. This reduces the
complexity of the entire system. Ensuring a loose-coupling of various
components is facilitated by dependency injection. Dependency
injection is the process of allowing a managing component to place a
needed resource in a component’s hand. Code for lookup or creation of
resources, in turn, is unneeded, and explicit implementation details
do not need to be hard-coded.
- Object-relational mapping (ORM) is the process of mapping relational
tables to object-oriented classes. Currently OMERO uses Hibernate
to provide this functionality. ORM allows the developer to work in a
known environment, here the type-safe world of Java, rather than
writing difficult to debug sql.
- Aspect-oriented programming, a somewhat new and misunderstood
technology, is perhaps the last technology which should be mentioned.
Various pieces of code (“aspects”) are inserted at various moments
(“joinpoints”) of execution. Collecting logic into aspects, whether
logging, transactions, security etc., also reduces the overall
complexity of the code.