Making developing chemistry based systems easier - new (and old) languages and frameworks on the Java virtual machine.Presentation

September 2010 Author: ()
Product group IT platform toolkit

The latest standards for enterprise systems based on the Java platform can provide new approaches bringing type-safety, better support for refactoring, more reuse, extensibility and testability to the development process. However, these approaches have not often been used in the development of chemistry based systems, such as those using Marvin and JChem, which typically still rely on approaches such as JDBC and JSP. We have investigated some of these more promising approaches for building Marvin and JChem based web applications. We will illustrate the use of: – Hibernate and JPA persistence frameworks that make writing database persistence code simpler and less error prone, and show how these can be used with JChem Cartridge and JChem Base, – modern component based web frameworks such as Wicket and Grails that promote reuse at the UI layer and allow web based applications or web services to be created with little effort, – alternative languages on the JVM such as Groovy as an to aid productivity and in creating domain specific languages.

Download

Subtitle for hearing impaired (hide)
0:01
ok so firstly this is not a talk about IJC that comes
0:06
later this afternoon
0:07
this is a talk about software development for chemistry applications
0:13
it’s a talk free geeks apologies to the chemists
0:18
and
0:18
basic premise is how to be able to make
0:23
ChemAxon based or more generally chemistry based applications easier
0:27
how to make the developments of those applications easier and faster
0:32
these are the people who
0:34
have been mostly involved with this the first three
0:37
come from Argentina and the fourth from Australia so
0:43
it is a pretty multinational
0:47
project this one, the aim
0:53
was to investigate how we could basically make web based
0:57
applications for chemistry
0:59
and how we could use the best of breed framework that often used in the
1:05
IT sector
1:07
and are not commonly used within
1:10
for chemistry applications
1:13
these frameworks
1:14
they basically do the heavy lifting for you
1:17
so you have to write much less codes
1:20
because the framework does the work for you
1:22
and the frameworks by using these frameworks gives you a chance to really get real code
1:27
reuse
1:28
rather than the copy paste code which we tend to use nowadays
1:34
and the other real benefits of using the framework is that we can insulate our selves
1:40
from the implementation details
1:43
and the the benefits as I see here would be that we can avoid the need for in our case
1:48
specialist JChem developer skills
1:51
and any
1:52
person who’s familiar with developing web based applications or even non web based applications
1:56
should be able to create a chemistry based application
2:00
they wouldn’t need to understand all the other details how JChem works to be
2:04
able to create that sort of application
2:10
so let’s look at it at at at at the example of how things work typically stay here is the JSP
2:15
example that am sure you’ve all seen
2:20
just this point here
2:21
we’ve got on the screen the sketcher
2:25
were we draw our molecule and over here on the right
2:28
we’ve got a large number of structures search options that needs to be specified
2:32
and this page really shows the best and the worst of uh… of of of the breed
2:37
the sketcher is put together here typically with a JavaScript code and this is really
2:41
nice it’s sort of the JavaScript prefers an API to how the sketcher should appear and behave
2:46
in the
2:47
in the browser
2:49
really all you have to do is to copy paste this bit of code re-program it and it will
2:52
work in your application
2:54
and when the end line of the implementation details of the sketcher changes
2:58
the API provided by the JavaScript will be updated in the ChemAxon library and everything
3:02
will still work
3:03
that’s happened quite recently
3:05
it happened
3:07
was it six months ago in one of the Marvin upgrades
3:10
and if you’re using this approach and everything worked
3:12
if you weren’t using it
3:14
you have to go in and change your codes because of those underlined changes
3:18
so this quit a nice example to how you can encapsulate
3:21
the implementation details to some extent
3:25
this bit over here on the right is really pretty ugly
3:28
this is the JSP page with a tiny fragment of the JSP page
3:32
and you can see it looks
3:34
but looks like a JSP page looks really really ugly we are mixing up database access code
3:39
presentation coder and everything here
3:41
and this is hundreds of lines of code
3:43
to get this if you’ve had wanted to do another application that’s what the status of options
3:47
you’ve got to copy and paste the whole codes
3:50
and it gets ugly it’s not nice
3:55
the second example is if you look at the the DAO level so this is how you might persist
4:01
the structure
4:02
in the data base
4:03
in this case where updating the structure of this is that the method called for updating
4:08
the structure
4:09
and I’m not going to go into his in details opposing to Java codes
4:12
but … people who have written this code will recognize that there’s a got-cha and pretty
4:16
well every line in this code you’ve got to know what you’re doing
4:19
the things that could probably come and
4:21
kick you in the painful bits if you’re not
4:25
careful
4:27
we don’t really want to be having like this for the level of code
4:30
in order to get
4:31
our application working
4:34
we also don’t want to have that level of knowledge to be able to write those applications
4:39
so there are various problems here
4:41
firstly we have to write tons and tons of codes
4:44
secondly
4:45
we do need specialist knowledge we’ve got to understand how Marvin works we’ve got
4:48
to understand how JChem works to be able to write these applications
4:51
and there are lots of traps
4:53
if you don’t do it right you will be caught
4:56
because we’re writing lots of codes we’ve got to do lots of testing
5:01
we probably don’t do lots of testing so we have a whole there
5:05
also it is difficult to test these codes it’s not easy to vigorously unit test
5:10
this sort of approach
5:13
and web application needs to change or migrate it’s difficult to re-factor an upgrade some major
5:18
its a major task to have to deal with those sorts of things
5:21
this generally results in the fact that we’re using copy and paste coding
5:26
rather than getting real code re-use
5:29
another problem here is we’re strongly coupled
5:32
to the underlying chemistry engine in our case is probably JChem if we wanted
5:37
to JChem even from JChem Based to JChem cartridge
5:41
it would be quite a lot of re-factoring
5:45
to have to do that sort of change and to change from JChem Base system to a similar base systems
5:50
preferably the other way around
5:51
it would be a huge amount of work
5:57
so let’s take a step back let’s look at how Java web based systems have evolved over time
6:03
originally
6:04
the first way to do things really was uh… when JDBC and JSP
6:08
started had to be available
6:10
that was very early in his in the days of Java
6:14
tend to be using an approach that is called sort of a model one architecture
6:19
and the JSP uh… example is the sort of classic example of this
6:23
and basically it end up with a code mess
6:25
you can write applications but very quickly they get unmaintainable
6:29
at you end up in a mess
6:32
quite quickly people realize that they’re getting into a mess
6:35
and something called model two and also known as web model view controller came along
6:40
I simplified initially by the Struts framework
6:44
that improves the architecture significantly
6:47
but it still was far from far from ideal
6:50
there was sort of a configuration hell you have to write so much XML file
6:53
lot of duplication of stuff it wasn’t nearly as productive as it should have been
6:58
but over time the model to architecture has improved their new framework such as Stripes
7:03
or Spring model view the controller
7:05
that make use of the improvements that have happened typically conventional configuration
7:11
which means just
7:13
put things in the right place they just work
7:15
you don’t have to configure it it just works but because the using the right of convention
7:19
and drives which stands for don’t repeat yourself
7:22
to configure everything ones
7:24
not multiple times
7:27
status couldn’t provide us with lots of improvements that overtimes but that there are still some limitations
7:31
in these sort of frameworks
7:34
and then finally more recently there have been some more object oriented
7:39
frame works available
7:40
Google Web Tool kit and Wiki are good samples here
7:43
these are more object oriented in nature and and provide some further improvements
7:48
like improved re-factoring support of the place to generally more object oriented approach
7:56
but the world outside Java was also doing things not surprisingly
8:00
and
8:01
probably about was it about
8:03
four years ago also maybe Ruby and Ruby on Rails really really started to become very prominent
8:10
and it really set the new standard
8:13
Ruby on Rails was a complete application that handled your complete application
8:17
all the way from the data based tier up to the presentation tier
8:21
it make extensive use
8:22
of convention over configuration and DRY
8:26
and it was because of the nature of the Ruby language it was a lot more productive environment
8:30
you could create an application much faster than you could using
8:33
using older
8:35
approaches like what is been used in the Java world
8:39
and Ruby on Rails really took off and became very successful
8:43
others of older and more conventional languages such as Python and PHP
8:47
but it may be that old limit that may be
8:49
not that but not so fashionable nowadays
8:52
but they were certainly still doing things in a framework for those that again
8:56
had followed many of these principles as well
8:59
and importantly they’ve announced some newer frameworks that are appearing
9:03
to run on the Java virtual machine that I think are particularly interesting to look at
9:07
but notably Groovy and Grails
9:10
and
9:10
Scala and Lift
9:12
so these are the new languages
9:14
that run on the Java virtual machine
9:16
they’re very strongly aligned with Java and they work
9:19
and really complement with Java very well so they have the same compliments
9:24
with the ChemAxon tools very well but they are a lot more productive
9:30
so what we don’t want to do is to look at
9:33
various of these things
9:34
and see how we could use them in chemistry
9:37
one thing I’m sure
9:38
all developers will be aware
9:40
there’s a huge amount of choice out there huge amount of web frameworks
9:43
the people could use to pretty well everything
9:45
whatever category XML, Web frameworks but components Ajax, Persistence
9:50
that’s a huge list this is just a tiny fraction
9:53
this can be very confusing
9:55
choosing which frameworks to use
9:57
is a very arbitrary decision because there are so many off of it is difficult to
10:01
make a subjective
10:03
supposed subjective decision on this
10:05
we’re not saying which is the best frameworks which has chosen ones that seem
10:10
to be seem to work well
10:11
and seem to have the right criteria for us
10:16
so
10:18
let’s take a step back, let’s think about the standard system this might
10:21
be a system we’re building for
10:25
a business unit not a chemistry based
10:29
system
10:31
these sort of systems generally have very simple data
10:33
they handle things like bank accounts, purchase orders, catalogue items, addresses at airline flights
10:39
things like that
10:40
the simple numerical text data and they are relatively easy
10:44
to handle
10:45
and for these sorts of application the Persistence tier
10:48
this is how the data is saved into the database
10:51
how it is read from the data base
10:54
how it is queried
10:56
this has been largely automated
11:00
using Persistence framework
11:03
or object related mapping tools they handle all the data base operations and really if you are building one of these standard systems nowadays
11:11
you won’t even consider doing that what is Persistence to yourself, you will rather use one of these Persistence frame works, such as hibernating to do that for you and to make your life a lot simpler
11:21
but chemistry software looks to me to be stuck
11:26
it’s not really benefiting from these recent developments
11:29
it tends to be what I say lovingly hand written we write the low level codes our selves
11:34
and we love it but it takes us
11:36
lot of time of do it and it has all of these draw backs that I mentioned earlier
11:40
and this results in poor productivity
11:43
why is this? why doesn’t chemistry do it the right way, why do we have to do
11:47
it in this
11:48
painful manner but can we solve problems
11:51
so that’s really the scenario that we started to look at
11:56
and what we did is really an experiment we said okay it shouldn’t be like
12:00
this let’s see how we could do it
12:02
and see how we can improve things
12:04
Si whit these experiments can these problems be solved?
12:09
so we have to ask you why is chemistry difficult why can’t we just treat molecules like a
12:14
purchase order
12:15
the reason for this is that the molecules are very complex
12:19
the CRUD operations this is the Persistence operations in the database
12:23
to create
12:24
retrieve updates and delete operations
12:27
at and most importantly the query
12:29
can not be expressed the simple SQL statements
12:32
because molecules are complex when we search in molecules we need to handle
12:37
chemical fingerprints we have to handle things like that we can’t just do that
12:40
as of simple SQL statement
12:42
and basically we need a chemistry engine to help
12:46
the right chemistry engine is JChem
12:50
at least chemistry
12:52
this in this context we’re talking about Marvin and JChem systems but what do the same
12:56
really would apply to whatever chemistry engine you are using
12:59
that typically
13:01
mostly JDBC or JSP based or maybe using some of these
13:07
frameworks after Struts in a more limited manner
13:09
they tend to be hand-written
13:12
they tend to use some of these more modern frameworks
13:16
in my experience they tend to use copy and paste codes with all the
13:19
disadvantages of that and they make very little use of components and re-use
13:24
of components
13:25
and the result is that they’re difficult to understand they’re difficult to upgrade
13:29
and they’re difficult test
13:34
but does it have to be this way well that’s what we wanted to investigate
13:37
we wanted to look at all other benefits of using languages other than Java Can Persistence frame work be used with JChem?
13:46
can we benefit from modern web frameworks?
13:49
can we get real code re-use?
13:51
and can we get real database and chemistry engine independence?
13:56
so can we just switch out
13:58
JChem and put into its place in JChem Cartridge
14:00
can we switch out Accord Cartridge and put into it’s place the JChem Cartridge
14:05
with minimum changes to our application codes
14:07
so the aim was really to simplify building a chemistry system using some of these best of breed tools
14:13
this is the application we built it’s not designed to be a very sophisticated application
14:17
it was a proof of principle
14:19
just to show that we could build this sort of application with these
14:23
frameworks is a very simple web based application
14:26
we import a number of vendor catalogues
14:28
into a simple data base relational database model there is a structure table
14:32
there is sample table so each structure has a number of samples
14:36
and each sample comes from a particular source the source will be the supplier
14:40
so it’s a very simple application it’s not supposed to be rocket science in terms of the application
14:44
is also not suppose to be sophisticated it’s also not the ultimate in user experience
14:48
what we’re trying to do is to sort out the technology side of things
14:52
and what we built would look like this from the architecture point of view
14:57
the different tiers of application but more importantly here on the right
15:01
the database we your we using we can just plug-in Oracle my-SQL or Derby probably other
15:07
databases as well
15:09
the Persistence framework we used was Hibernate
15:11
and the web framework we used was Wicket
15:14
by quite a day comes up to use the JChem had to do to the structure Persistence of wickets
15:19
Hibernate was optionally used in JChem to do the structure Persistence and Wicket was optionally used in Marvin to do the structure display
15:23
so the ideal situation would be
15:27
that the structures don’t get in the way
15:30
we can look at this really for other tables the source on the sample table
15:34
cause these are just plain data tables
15:36
to simplify this I’ve got a suitable code here
15:41
if we’d like written these application using Groovy & Grails
15:45
and these were the main objects for the source class and for the sample class
15:49
this is all the codes you will have to write
15:53
you define properties you define the relationship between the source table and
15:57
the sample table
15:58
and then you can just write codes
16:01
that runs the query
16:03
sample finds by codes and it’ll look up that code
16:06
this methods
16:07
in the Grails framework
16:10
is automatically generated for you
16:12
I haven’t written that methods
16:14
it’s generated dynamically in run time
16:16
based on convention that you’re using find by codes
16:20
and it looks up the fact that is
16:22
find by means: I want to do a search code well let’s see if I’ve got a field called sort by code
16:27
oh I have therefore
16:29
I’ll run that as a query
16:31
to delete that’s sample you just do sample “dot” delete
16:36
so in an ideal world
16:37
you end up with codes like this which is really really simple try to write really really simple
16:41
to use
16:46
but that doesn’t handle all the structure tables
16:48
for structures we’ve got a problem because we’re using JChem Based
16:52
JChem Base
16:53
is necessary because we want to be able to search we can’t get rid of it other wise
16:57
we won’t be able to search for our structures
16:59
and this a screen shots of the architecture for JChem Base for how it works
17:04
in a browser based environment
17:06
the issue is that we must use the JChem API
17:10
that involves using some classes which maybe familiar with developers connection handler
17:15
update handler JChem search
17:17
so we have to pass our queries through the JChem API but we also need
17:21
to use plain SQL so we need to generate SQL because these become filters
17:26
on the JChem search
17:27
also if we do things like creating tables then we need to go through the JChem API
17:32
again we can’t do that purely with SQL
17:35
and so it’s not obviously suited
17:38
to the SQL generation framework such as
17:42
as such as Hibernate
17:43
or JPI
17:45
can we solve that problem?
17:49
well…let’s take a look at cartridge in fact before we do that
17:53
cartridge is a bit easier because we’ve
17:55
got function calls here
17:58
that basically encapsulate the JChem engine
17:59
so everything can be done with SQL and thats the real beauty of the cartridge
18:02
the issue is that it’s not standard SQL we’ve got this JChem operators, JC formula,
18:07
JC compare, JC evaluate and things like that
18:10
cause this is non-standard SQL
18:12
but we can basically customize our SQL generator in our Hibernator
18:17
to generate the sort of SQL for us
18:20
so with cartridge it is a bit easier
18:24
if we were now extending our Groovy & Grails application
18:27
now to include a structure table
18:29
that was using the JChem Cartridge
18:31
it looks a bit like this
18:33
quite similar to what we saw before we see the fields the structure field the molecular formula
18:37
the molecular weight field
18:38
or we just have to use a little trick here to say that the molecular formula
18:42
is a formula
18:43
which is JC formula structure
18:47
when the sequence is generated it uses that formula
18:52
to retrieve the value for formula and molecular weight
18:57
so its only just a slight change to the basic scenario
19:00
so for cartridge we can solve this pretty nicely
19:03
it doesn’t actually solve query we still have to do a bit more work in
19:07
to get a query status
19:09
but we could use named queries which specifies the query at a
19:14
SQL level
19:14
and because with the cartridge we can do everything with plain SQL
19:19
that provides a satisfactory solution for most cases
19:22
the problem with cartridge though is of course only suitable if you want to go Oracle
19:27
and it’s only suitable if you are running the cartridge in Oracle
19:32
so can we have a more generic solution here
19:36
the question is can JChem Base be tamed
19:39
so that it can work with Hibernator or JPI
19:43
if we do this
19:44
can the developer work
19:47
with this in a way
19:49
that it is agnostic to the chemistry engine been used
19:52
so can we just switch out one chemistry engine and put in another chemistry engine
19:57
and non of our application codes needs to be changed
20:00
so how we do this this is the real geek section here for the next minute or two
20:05
we’re doing this using the Hibernate event model
20:09
this is the Java doc for this particular package
20:14
and the whole lot of listeners
20:17
that you could attach to Hibernate
20:19
which basically you can use to intercept the cause to Hibernate
20:25
so either before or after Hibernate does something
20:26
you can put on an interceptor
20:28
and hook in your code there
20:30
the whole list of these
20:31
which basically lets you Hook things up to when structures are inserted, deleted, updated
20:36
or whatever
20:37
and you can hook in your own code to customize how that’s going to happen
20:42
so what’s
20:44
what we do is that we have created that something which we call the chemistry
20:48
engine
20:50
and the bridge
20:52
what happens at the Persistence level
20:56
the user let’s say wants to persist a structure in the data base
21:00
they’ve got a new structure and they want to save that in the data base as a new row
21:05
the Hibernate
21:06
framework in this case is the JPA framework
21:13
we hook in to these events
21:17
through
21:19
a bridge so the
21:21
bridge is notified that Hibernate is wanting to persist a structure
21:25
then that engine bridge is then pass it onto the implementation
21:30
and says a structures wants to be updated
21:32
or inserted
21:34
an then the engine implementation
21:38
persists that structure
21:40
in the way that is appropriate for that particular engines so in our case using the
21:46
JChem Base API
21:49
to see this slightly more in action
21:51
we are persisting
21:53
a structure here this is up to the hibernating level
21:56
so we just say entity manager persists this structure
22:01
so which I just save that structured into the data base
22:03
the pre-insert event listener picks this up
22:07
so this is the listener that let’s you
22:09
hook in codes before
22:11
the structure
22:12
would be inserted into the data base table
22:16
the bridge
22:18
causes on pre-insert methods
22:20
and then passes that onto the particular engine that’s been used
22:23
and the engine says… create structure
22:25
create structure uses the JChem Base API in this case update handler
22:32
to insert the structures into the JChem table
22:35
and when that’s done
22:37
the
22:39
control
22:40
is passed back to the hibernating
22:44
layer which basically saves it and that will commit the transaction
22:47
that will then
22:48
commit the SQL
22:52
for the other data into the data base
22:56
so engine bridge looks a bit like this we just have intercepting calls for
23:00
on pre-insert, on pre-updates, on post-delete and on post-loads
23:06
and this just passes each of those onto the particular engine implementation
23:13
and this is what the engine looks like in this case this is the JChem Base engine
23:18
we have a method called create structure
23:22
and this codes looks almost identical
23:24
to the code that we saw earlier
23:27
because we are using the JChem API to persist it, but the differences is that
23:31
this code is now in the library
23:34
the developer is not having to write this code
23:37
all they’re having to do
23:39
is what work at Persistence framework level
23:43
this implementation detail is completely hidden to the developer
23:48
and a different engine would
23:49
do the Persistence in a completely different manner
23:56
and so this is a structure entity in this case we’ll do it in Java and not in Groovy
24:03
we got
24:05
fields for molecular weights for formula for getting the samples and things like that
24:10
it looks very standard
24:13
uh…
24:14
entity
24:15
we can also define in this case a standardizer so that when the table is created we get the right standardization
24:20
rules
24:21
and
24:22
most of the things can be configured with annotations
24:25
so we can define what the structure table is called and things like that and parameters for other stereo types
24:29
and how the stereo is handled and things like that
24:35
this is really the important bits all the rest is the geeky implementation details
24:38
this is what the developer would actually need to do to actually use this
24:45
we got a method let’s say in our service tier
24:48
we want to create a structure
24:49
what we do we call an entity manager persist
24:53
for that structure
24:55
we’re going to look up a structure based on its ID
24:58
the developer the only thing they have to write is entity manager find 0:25:02.920,0:25:06.280 so the developer now is working in this completely
25:06
agnostic manner not needing to know what the
25:09
underlying implementation details are
25:15
and to prove this one of the aspect is the plugability
25:20
hibernating isolates you from the underlined data base
25:23
so
25:24
so if you write the same hibernating code doesn’t matter if you’re using a my SQL data base
25:28
or an Oracle database
25:30
Hibernate handles the translation for you
25:33
in our chemistry engine now also isolates you from the underlined
25:39
chemistry implementation so we can now swap in and swap out our engines
25:43
so this ia the only configuration change that you need to make to change
25:48
from using JChem Base to using JChem Cartridge
25:51
you just need to change the name, the class name of
25:52
the chemistry engine in this particular configuration for just one
25:57
line of code
25:58
you’ve switched from using JChem Base to using JChem Cartridge
26:07
query is a bit more complex I’ve got a very simplified representation
26:11
of this here and I don’t really have time
26:14
to go into
26:15
it in details
26:20
we’ve got to do a bit more work here
26:21
to enable query to work it’s not trivial because of the way
26:25
we have pass the query through the JChem Base API but also we use SQL generation
26:30
to generate
26:32
a SQL filter that is passed onto
26:36
the JChem API
26:37
but the implementation basically deals with that
26:40
we have an object oriented representation of the query that you sketch in
26:46
the browser
26:47
that then gets inspected and translated into a form that can be executed by the particular
26:52
engine
26:53
the results you get back is a hit list
26:56
of the IDs
26:57
it’s not
26:58
fully loaded entities which would be a performance
27:02
you just get a list of your hits and then you can go back to the database retrieve
27:06
the actual real data of the structures or whatever for those particular lists
27:10
so it’s really isn’t hard here to go into querier in detail
27:15
but the engine implantation
27:18
does
27:19
support querying
27:21
as well as the basic persistent stuff
27:24
another aspect of this is were we using the Wicket framework for doing
27:28
the presentations tier
27:31
and the service tier
27:32
just to illustrate the benefits of using these sort of frameworks
27:36
let’s say we wanted to expose certain
27:39
parts of this application as a web service
27:42
well this is the entire code that is needed to do this
27:46
firstly you would have to enable
27:47
restful web services at it’s best level this is what the configuration change
27:53
needs to make
27:56
in the
27:59
container level
28:01
configuration file basically just to enable the web services
28:04
to expose the functionality in our service tier
28:07
this is the method in our service tier
28:09
we just have to provide the right annotations
28:12
but basically enabled the web service
28:14
and then to use it, here is a bit of Groovy codes
28:17
that we’re actually calling the web service that’s the URL
28:33
so web services we don’t have to develop web services
28:38
all we need to do is turn them on really
28:40
which makes a huge difference
28:49
so just to show that this isn’t all
28:52
smoke and mirrors
28:54
there is something behind it some real codes that runs
28:56
this is the application
29:03
so we’ve got a very basic way of browsing through the structures we can select
29:07
a structure here and see which vendors it’s available from
29:10
most importantly we want to be able to search so we go onto the search tab here
29:15
and here we’ve got a familiar
29:17
two people
29:19
can specify the search type
29:21
we can
29:23
enter in our substructure
29:28
and
29:30
run it
29:31
and we get our search results back so all
29:35
of this is going
29:37
through this frameworks I’ve just described the Persistence framework is done by Hibernate
29:42
the implementation here is JChem Base engine
29:47
the data base that is been searched in this case
29:52
is a Derby data base
29:54
but all of those things are pluggable and switch-out able
29:59
as I said it’s not designed to be a sophisticated application it’s just a proof of principle
30:04
that the technology
30:06
does work
30:07
and is usable
30:12
also I should add the Wicket
30:14
uh…
30:17
components here for encapsulating the sketcher and for the options
30:22
so these components now could just be
30:23
re-used in other applications so we don’t have to copy & paste the whole lucky code
30:28
that we saw before
30:29
this is just a component that you can include in your web page and at all other options and
30:33
that reappear
30:34
in your next application
30:36
so in summary
30:38
did we succeed well from the Persistence point of view yes we pretty clearly
30:43
did succeed here
30:44
the approach seems to be successful we have recreated a meaningful but yet simple web
30:50
application
30:50
that uses these JPI interfaces in a very clean manner
30:55
so any developer
30:56
who’s familiar with using Hibernating or JPA
30:59
could develop these sort of applications
31:01
they wouldn’t need to understand anything about JChem
31:04
or anything about Marvin
31:07
we’ve given
31:09
our selves some vendor agnosticism
31:13
that at least we switch between JChem Base and JChem cartridge
31:18
we haven’t yet tried switching between other vendors engines that going to be more difficult
31:21
I think that it should be possible
31:25
that the
31:28
engine is pluggable
31:30
in the web tier we haven’t really done anything near as much most of the work
31:34
and the experiments we’ve done
31:37
is off a Persistence tier the web tier is relatively limited
31:41
we’ve got a smaller amount of Wicket components like the one for the sketcher and the one for the search options
31:45
the reason
31:46
why we haven’t done so much here is cause there are so many web frameworks
31:51
that’s we don’t really know whether we using the right one, I mean we like Wicket
31:55
but you might not
31:56
and each companies is probably going to have their own
31:58
favourite framework to use
32:00
and so is not probably worth our while one investing a lot of time in a
32:04
particular web framework here
32:07
unless there is some sort of consensus
32:09
that that is the one to use
32:12
across
32:14
many of you
32:19
so the components that we are generating some of this system is wrote to be shorter
32:25
while some of it is more medium term
32:26
the engine architecture implementation that is the JChem Base and the JChem cartridge
32:31
implementations
32:32
those are developed we’re also generating a Groovy library
32:37
that basically encapsulates JChem
32:41
so if you’re using Groovy and for any Java developer who hasn’t
32:46
looked at Groovy are really do recommend you do it compliments Java really really nicely
32:51
in terms
32:52
of web components
32:54
we could
32:55
produce
32:56
components for any number frameworks
33:00
standard JSP tanks the GSP for the Groovy & Grails framework
33:06
wickets
33:07
whatever we that we don’t really know what the demands would be here which frameworks people
33:10
really want to use
33:12
if you got any particular suggestions or comments in this area
33:16
we would suddenly like to see them
33:18
so the components we could create and have
33:20
at least for Wickets are the sketcher components ones for displaying structures
33:26
so the table component that displays the search results
33:30
and the search options probably a few more and we can create those as well
33:34
and we’re open to suggestions for what might be useful
33:39
what will be available first I should say these are experimental tools they’re not ready
33:43
for a production environment yet
33:46
we need to do more work to make insulated usable in a production environment
33:50
you’d be interested
33:51
to find out whether you think that is something we should
33:54
be doing
33:57
we’re glad to use those for maybe creating internal systems and maybe for consultancy
34:03
projects as time goes on
34:06
uh…
34:07
and the components may become of the available as extensions to Jchem if there is a demand
34:12
so it’s
34:13
way quit similar to have web services provided at the moment as an extension to JChem
34:18
we might provide these frameworks extensions to JChem as well for customers wanting to
34:23
use the sort of thing
34:24
we’re looking for active people who have experiences so I know
34:28
some people have started looking at this sort of things as well
34:34
we are
34:37
welcome to hear
34:38
for people who might be interested in taking this sort approach using these things
34:44
so that’s it
34:46
thank you for your time
34:48
have we got time for any questions?
34:51
first of all thank you that’s a great talk
34:58
and we have a question
35:02
so for the structure
35:05
annotation it looks like you had the table type annotation
35:07
says that some more classes you added to be able to create the JChem tables
35:13
you believe this the slide where we have annotation up here
35:17
that basically specify the name of the table the JChem table that
35:21
is been created
35:23
uh… we’ve got annotation here for the type of tabling in this case we’re using a molecules table
35:28
though we could specify Markush table
35:31
or reactions table
35:32
so how yes we’ve got some um…
35:36
parts of the framework handles the DDLS aspects of this
35:41
Hibernate could create the tables for you
35:44
it’s no good if it only creates the non-structure table for you
35:48
so we’ve got hope in here as well
35:51
so that it reads these annotations
35:53
and then it creates the JChem table
35:56
with those particular attributes of the right table types the right standardizer configuration
36:00
the right
36:03
stereo option things like that
36:05
so you start with an empty database
36:07
the Hibernate will create the all of those tables for you
36:13
and with the connection stuff what you integrated
36:16
just to confirm to the slide was kind of quick the connection that was been passed in
36:20
that was from
36:22
that was the active connection with the open transaction right so roll backs in everything would be
36:26
yes that’s the connection I told you from the hibernating section
36:30
so it’s done within the same transaction thet Hibernate is managing