We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Code Base Improvement

Shai, I think you hit the nail right on the head when you mentioned the fact that business rules are scattered all over the code. That was one of the main things I had trouble with when trying to build my “external hook” into the code. Simply creating a subject, then creating and populating an event took a lot of major digging into the code to figure out exactly what had to happen.

That action (which I would consider a very common, useful function) required me to write 1182 lines of code and create 13 DAO’s. All that and I still do not know if I have satisfied all the business rules in the code. For all I know, I’m putting the database in some sort of wacked out state that will bite me later down the line… hope not.

I would like to see the code cleaned up in such a way that there are a few specialized controllers which provide functionality with a clean interface. I’d also like to see fewer beans. In fact, I think it would be awesome to get rid of a lot of the support code and concentrate on the main goal… clinical studies.

I think one way to achieve this code cleanup is though using some common java frameworks. I have chosen spring and hibernate as my frameworks of choice only because they seem a natural fit to my coding style. I fought with struts for a few months when I was at a web development company 4 years ago… I didn’t agree with strut’s methodology?…. Can’t think of the word… It just didn’t seem right.

I sat down with Spring for a half day and was blown away with how productive it allowed me to be. I could concentrate on my business and leave the infrastructure to the spring development team.. amazing. As a counter point.. I’m sure there are a ton of people who are more comfortable with struts than spring for the same reasons.

I feel the same about hibernate. I just like it. And, the fact that it will generate code and database schema automatically is a big plus. I like writing software that writes itself.


At any rate, I can’t emphasize any more how important I think it is to leverage frameworks to make code more concise and maintainable by a larger population.

I wish I could get into some sort of front-end framework like JSF or tapestry.. sadly, I haven’t taken the time to learn any and therefore my jsp pages are an absolute mess.


Any thoughts?




The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
Sent: Friday, January 20, 2006 10:59 AM
To: [email protected]
Subject: RE: [Developers] first post.

Hi Jordan and Shai,

You both raise very good points about incorporating frameworks into the OpenClinica code. Jordan, some of us had also previously been discussing the idea of using Struts Action to take over for our control servlets, do you have any experience with either Struts package (Action or Shale) and how they stack up against Spring? What are some of the tradeoffs?

Shai, you raise a good point about the business logic layer--we had discussed getting Drools to help us with that a little and I had put some stubs of code for a small business-logic class in the code base, they should still be there under org.akaza.openclinica.logic.core.

Jordan, the regular expression code is in the 1.0 release, and I would certainly like to hear more about the external hooks you were able to put into the system. What application did you use to package them up? Were there issues with security and user validation?

Cheers,
Tom

Tom Hickerson
Senior Project Coordinator
Akaza Research
One Kendall Square, Bldg 400, Fourth Floor
Cambridge, MA 02139
p 617.621.8585 x15
f 617.621.0065
"Open informatics for public research"
http://www.akazaresearch.com/
Sent: Friday, January 20, 2006 10:55 AM
To: Woerndle,Jordan; [email protected]
Subject: RE: [Developers] first post.
Hi Jordan,

Thanks for your email. Certainly a lot of good ideas in here.

Porting OpenClinica to Hibernate is certainly a good idea, and I hope to look into that in the near future. From a code infrastructure point of view, what other ideas do you have on improving the code base? For example, another priority for me is to clean up the Validation class and define a clean interface so that developers can create new validation types by subclassing an abstract ValidationType class (or something like that.) The current class started out as a much more lightweight piece of code, but I think an overhaul is in order.

Another priority is developing a business rules layer separate from the servlet/form processing layer. Right now there are a lot of business rules running around the application - for example, you can't perform double data entry on a CRF unless a) you did not perform the first round of data entry or b) more than 12 hours have passed since you completed the first round of data entry. This is a good rule, but it's hard to find in the code. It would be nice to put such rules in small, easy to find (and change, if the mood strikes you) classes. We did some research on business rules engines a while back, and at some point I'd like to dust that off and see if we can't work it into the code base.

Any other thoughts?

Shai Sachs
Director of Research and Development
Isovera.com
One Kendall Square, Building 400
Cambridge, MA 02139
office: 617-621-8555 x 12
mobile: 617-833-3648
http://www.isovera.com
Sent: Thursday, January 19, 2006 4:56 PM
To: [email protected]
Subject: [Developers] first post.
Hi there,

I’m glad to see the developer’s mailing list up and running. Tom asked me to start a thread on how I integrated beanshell to support scriptable actions on individual items. I’d be happy to explain if anyone is interested. In fact, let me know if you’re interested in my implementation of:

Regular expression data entry validation (is that included in the 1.0 release?)

BeanShell scripting for data entry validation (ranges, data types, calls to external sources.. pretty much anything you can think of.)

External hooks to create subjects and events in response to external events. I built a client app that packages data and ships it to our server. OpenClinica can pick the data up and create/populate new events. It will also notify people that new events are ready for review.

As a side note, does anyone want to port openclinica to use spring/hibernate/acegi? Why? Well, I couldn’t bend OpenClinica to do something we needed so I spent the last month building something from scratch. I built similar features into my new app with about 530k of source code (including jsp’s) and configuration. My last count of open clinica source is 4 MB and about 2MB of jsp’s.

Jordan


The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.

Comments

  • http://sandbox.sourcelabs.com/kosta/web_ui_compare/readme/index.html

    Cheers, Tom

    Tom Hickerson
    Senior Project Coordinator
    Akaza Research
    One Kendall Square, Bldg 400, Fourth Floor
    Cambridge, MA 02139
    p 617.621.8585 x15
    f 617.621.0065
    "Open informatics for public research"
    http://www.akazaresearch.com/
    Sent: Monday, January 23, 2006 12:15 PM
    To: [email protected]
    Subject: [Developers] Code Base Improvement
    Shai, I think you hit the nail right on the head when you mentioned the fact that business rules are scattered all over the code. That was one of the main things I had trouble with when trying to build my “external hook” into the code. Simply creating a subject, then creating and populating an event took a lot of major digging into the code to figure out exactly what had to happen.

    That action (which I would consider a very common, useful function) required me to write 1182 lines of code and create 13 DAO’s. All that and I still do not know if I have satisfied all the business rules in the code. For all I know, I’m putting the database in some sort of wacked out state that will bite me later down the line… hope not.

    I would like to see the code cleaned up in such a way that there are a few specialized controllers which provide functionality with a clean interface. I’d also like to see fewer beans. In fact, I think it would be awesome to get rid of a lot of the support code and concentrate on the main goal… clinical studies.

    I think one way to achieve this code cleanup is though using some common java frameworks. I have chosen spring and hibernate as my frameworks of choice only because they seem a natural fit to my coding style. I fought with struts for a few months when I was at a web development company 4 years ago… I didn’t agree with strut’s methodology?…. Can’t think of the word… It just didn’t seem right.

    I sat down with Spring for a half day and was blown away with how productive it allowed me to be. I could concentrate on my business and leave the infrastructure to the spring development team.. amazing. As a counter point.. I’m sure there are a ton of people who are more comfortable with struts than spring for the same reasons.

    I feel the same about hibernate. I just like it. And, the fact that it will generate code and database schema automatically is a big plus. I like writing software that writes itself.


    At any rate, I can’t emphasize any more how important I think it is to leverage frameworks to make code more concise and maintainable by a larger population.

    I wish I could get into some sort of front-end framework like JSF or tapestry.. sadly, I haven’t taken the time to learn any and therefore my jsp pages are an absolute mess.


    Any thoughts?




    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
    Sent: Friday, January 20, 2006 10:59 AM
    To: [email protected]
    Subject: RE: [Developers] first post.

    Hi Jordan and Shai,

    You both raise very good points about incorporating frameworks into the OpenClinica code. Jordan, some of us had also previously been discussing the idea of using Struts Action to take over for our control servlets, do you have any experience with either Struts package (Action or Shale) and how they stack up against Spring? What are some of the tradeoffs?

    Shai, you raise a good point about the business logic layer--we had discussed getting Drools to help us with that a little and I had put some stubs of code for a small business-logic class in the code base, they should still be there under org.akaza.openclinica.logic.core.

    Jordan, the regular expression code is in the 1.0 release, and I would certainly like to hear more about the external hooks you were able to put into the system. What application did you use to package them up? Were there issues with security and user validation?

    Cheers,
    Tom

    Tom Hickerson
    Senior Project Coordinator
    Akaza Research
    One Kendall Square, Bldg 400, Fourth Floor
    Cambridge, MA 02139
    p 617.621.8585 x15
    f 617.621.0065
    "Open informatics for public research"
    http://www.akazaresearch.com/
    Sent: Friday, January 20, 2006 10:55 AM
    To: Woerndle,Jordan; [email protected]
    Subject: RE: [Developers] first post.
    Hi Jordan,

    Thanks for your email. Certainly a lot of good ideas in here.

    Porting OpenClinica to Hibernate is certainly a good idea, and I hope to look into that in the near future. >From a code infrastructure point of view, what other ideas do you have on improving the code base? For example, another priority for me is to clean up the Validation class and define a clean interface so that developers can create new validation types by subclassing an abstract ValidationType class (or something like that.) The current class started out as a much more lightweight piece of code, but I think an overhaul is in order.

    Another priority is developing a business rules layer separate from the servlet/form processing layer. Right now there are a lot of business rules running around the application - for example, you can't perform double data entry on a CRF unless a) you did not perform the first round of data entry or b) more than 12 hours have passed since you completed the first round of data entry. This is a good rule, but it's hard to find in the code. It would be nice to put such rules in small, easy to find (and change, if the mood strikes you) classes. We did some research on business rules engines a while back, and at some point I'd like to dust that off and see if we can't work it into the code base.

    Any other thoughts?

    Shai Sachs
    Director of Research and Development
    Isovera.com
    One Kendall Square, Building 400
    Cambridge, MA 02139
    office: 617-621-8555 x 12
    mobile: 617-833-3648
    http://www.isovera.com
    Sent: Thursday, January 19, 2006 4:56 PM
    To: [email protected]
    Subject: [Developers] first post.
    Hi there,

    I’m glad to see the developer’s mailing list up and running. Tom asked me to start a thread on how I integrated beanshell to support scriptable actions on individual items. I’d be happy to explain if anyone is interested. In fact, let me know if you’re interested in my implementation of:

    Regular expression data entry validation (is that included in the 1.0 release?)

    BeanShell scripting for data entry validation (ranges, data types, calls to external sources.. pretty much anything you can think of.)

    External hooks to create subjects and events in response to external events. I built a client app that packages data and ships it to our server. OpenClinica can pick the data up and create/populate new events. It will also notify people that new events are ready for review.

    As a side note, does anyone want to port openclinica to use spring/hibernate/acegi? Why? Well, I couldn’t bend OpenClinica to do something we needed so I spent the last month building something from scratch. I built similar features into my new app with about 530k of source code (including jsp’s) and configuration. My last count of open clinica source is 4 MB and about 2MB of jsp’s.

    Jordan


    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
  • Jun XuJun Xu Posts: 20
    As to Hibernate, we just started to think about how to use it to replace our original data access/persistence layer. Some very complex queries are used in
    OpenClinica. The performance consideration is the one reason why we wanna try Hibernate. The Hibernate website claims that its "overhead is much less than 10% of the JDBC calls." But I can imagine we cannot just use some OR mapping files plus insert/update/delete to replace our old large queries, we need to use Hibernate Query Language. Does anyone have experience on HQL? It seems a lot of work if we rewrite all our queries using HQL... But one big benefit I can see here is that we don't have to change our HQL queries to support different types of databases. I still don't like to put SQL statements inside Java code, so probably we still wanna using apache digester... Any thoughts?

    -Jun
    Sent: Monday, January 23, 2006 12:15 PM
    To: [email protected]
    Subject: [Developers] Code Base Improvement
    Shai, I think you hit the nail right on the head when you mentioned the fact that business rules are scattered all over the code. That was one of the main things I had trouble with when trying to build my “external hook” into the code. Simply creating a subject, then creating and populating an event took a lot of major digging into the code to figure out exactly what had to happen.

    That action (which I would consider a very common, useful function) required me to write 1182 lines of code and create 13 DAO’s. All that and I still do not know if I have satisfied all the business rules in the code. For all I know, I’m putting the database in some sort of wacked out state that will bite me later down the line… hope not.

    I would like to see the code cleaned up in such a way that there are a few specialized controllers which provide functionality with a clean interface. I’d also like to see fewer beans. In fact, I think it would be awesome to get rid of a lot of the support code and concentrate on the main goal… clinical studies.

    I think one way to achieve this code cleanup is though using some common java frameworks. I have chosen spring and hibernate as my frameworks of choice only because they seem a natural fit to my coding style. I fought with struts for a few months when I was at a web development company 4 years ago… I didn’t agree with strut’s methodology?…. Can’t think of the word… It just didn’t seem right.

    I sat down with Spring for a half day and was blown away with how productive it allowed me to be. I could concentrate on my business and leave the infrastructure to the spring development team.. amazing. As a counter point.. I’m sure there are a ton of people who are more comfortable with struts than spring for the same reasons.

    I feel the same about hibernate. I just like it. And, the fact that it will generate code and database schema automatically is a big plus. I like writing software that writes itself.


    At any rate, I can’t emphasize any more how important I think it is to leverage frameworks to make code more concise and maintainable by a larger population.

    I wish I could get into some sort of front-end framework like JSF or tapestry.. sadly, I haven’t taken the time to learn any and therefore my jsp pages are an absolute mess.


    Any thoughts?




    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
    Sent: Friday, January 20, 2006 10:59 AM
    To: [email protected]
    Subject: RE: [Developers] first post.

    Hi Jordan and Shai,

    You both raise very good points about incorporating frameworks into the OpenClinica code. Jordan, some of us had also previously been discussing the idea of using Struts Action to take over for our control servlets, do you have any experience with either Struts package (Action or Shale) and how they stack up against Spring? What are some of the tradeoffs?

    Shai, you raise a good point about the business logic layer--we had discussed getting Drools to help us with that a little and I had put some stubs of code for a small business-logic class in the code base, they should still be there under org.akaza.openclinica.logic.core.

    Jordan, the regular expression code is in the 1.0 release, and I would certainly like to hear more about the external hooks you were able to put into the system. What application did you use to package them up? Were there issues with security and user validation?

    Cheers,
    Tom

    Tom Hickerson
    Senior Project Coordinator
    Akaza Research
    One Kendall Square, Bldg 400, Fourth Floor
    Cambridge, MA 02139
    p 617.621.8585 x15
    f 617.621.0065
    "Open informatics for public research"
    http://www.akazaresearch.com/
    Sent: Friday, January 20, 2006 10:55 AM
    To: Woerndle,Jordan; [email protected]
    Subject: RE: [Developers] first post.
    Hi Jordan,

    Thanks for your email. Certainly a lot of good ideas in here.

    Porting OpenClinica to Hibernate is certainly a good idea, and I hope to look into that in the near future. >From a code infrastructure point of view, what other ideas do you have on improving the code base? For example, another priority for me is to clean up the Validation class and define a clean interface so that developers can create new validation types by subclassing an abstract ValidationType class (or something like that.) The current class started out as a much more lightweight piece of code, but I think an overhaul is in order.

    Another priority is developing a business rules layer separate from the servlet/form processing layer. Right now there are a lot of business rules running around the application - for example, you can't perform double data entry on a CRF unless a) you did not perform the first round of data entry or b) more than 12 hours have passed since you completed the first round of data entry. This is a good rule, but it's hard to find in the code. It would be nice to put such rules in small, easy to find (and change, if the mood strikes you) classes. We did some research on business rules engines a while back, and at some point I'd like to dust that off and see if we can't work it into the code base.

    Any other thoughts?

    Shai Sachs
    Director of Research and Development
    Isovera.com
    One Kendall Square, Building 400
    Cambridge, MA 02139
    office: 617-621-8555 x 12
    mobile: 617-833-3648
    http://www.isovera.com
    Sent: Thursday, January 19, 2006 4:56 PM
    To: [email protected]
    Subject: [Developers] first post.
    Hi there,

    I’m glad to see the developer’s mailing list up and running. Tom asked me to start a thread on how I integrated beanshell to support scriptable actions on individual items. I’d be happy to explain if anyone is interested. In fact, let me know if you’re interested in my implementation of:

    Regular expression data entry validation (is that included in the 1.0 release?)

    BeanShell scripting for data entry validation (ranges, data types, calls to external sources.. pretty much anything you can think of.)

    External hooks to create subjects and events in response to external events. I built a client app that packages data and ships it to our server. OpenClinica can pick the data up and create/populate new events. It will also notify people that new events are ready for review.

    As a side note, does anyone want to port openclinica to use spring/hibernate/acegi? Why? Well, I couldn’t bend OpenClinica to do something we needed so I spent the last month building something from scratch. I built similar features into my new app with about 530k of source code (including jsp’s) and configuration. My last count of open clinica source is 4 MB and about 2MB of jsp’s.

    Jordan


    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
  • This is Scott Li from Thomas Jefferson Univ. I think nothing is blocking you from using SQL if the only need here is to avoiding SQL Statement inside Java code. Two ways you can avoid this:
    1. Use iBATIS and DAO.
    2. Implement a SQL repository, from which all SQL statement retrieved based on its ID.

    For the second solution, we have implemented a MBean Service, serving as a SQL repository on top of iBATIS, which make the local database access transparent to your applications. Inside this framework, you split developer and DBA's role, each focus on their own expertise. DBA just focus on repository part, developers focus on business logics.

    I am not sure if this is what you are looking for...

    Also I am interesting to know how open your project is, interested to know if Jefferson can join as part of the project, we have our legacy clinical trial systems here that needs to be in caBIG in the future. Recently we are put together a proposal for the Clinical Trial Calendar. Is openclinica an caBIG compliant software, how about the BRIDG model?


    Scott
  • Jun,

    You bring up an interesting point. If the only goal is to support different types of databases, I do not think hibernate is necessary. In fact, I think it would be a waste of work. I mean, I haven’t seen any sql that is too terribly database dependent (besides maybe the triggers?) and the sql is already sitting nicely outside the java code… In other words, I don’t see anything wrong with the current setup.

    Another way to look at it is demand for database independence. Is there a real demand for automatically supporting every database out there? You have oracle and an open source dbms. That’s pretty good coverage right there.

    I think my point about hibernate was this. If we get a chance to refactor the code and pull the business logic out, it may be a good time to start using hibernate. That way we could have a few, simple beans and a simple insert/update/delete dao layer. The business logic would take care of the complex work in the object space (not at the data level). We wrap each unit of complex work in a transaction (using spring) and a lot of the hairy work is taken care of (and tested) by the frameworks. We simply concentrate on the logic.

    Easier said than done, of course.

    Jordan


    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
    Sent: Thursday, February 09, 2006 10:17 AM
    To: [email protected]
    Subject: RE: [Developers] Code Base Improvement

    As to Hibernate, we just started to think about how to use it to replace our original data access/persistence layer. Some very complex queries are used in
    OpenClinica. The performance consideration is the one reason why we wanna try Hibernate. The Hibernate website claims that its "overhead is much less than 10% of the JDBC calls." But I can imagine we cannot just use some OR mapping files plus insert/update/delete to replace our old large queries, we need to use Hibernate Query Language. Does anyone have experience on HQL? It seems a lot of work if we rewrite all our queries using HQL... But one big benefit I can see here is that we don't have to change our HQL queries to support different types of databases. I still don't like to put SQL statements inside Java code, so probably we still wanna using apache digester... Any thoughts?

    -Jun
    Sent: Monday, January 23, 2006 12:15 PM
    To: [email protected]
    Subject: [Developers] Code Base Improvement
    Shai, I think you hit the nail right on the head when you mentioned the fact that business rules are scattered all over the code. That was one of the main things I had trouble with when trying to build my “external hook” into the code. Simply creating a subject, then creating and populating an event took a lot of major digging into the code to figure out exactly what had to happen.

    That action (which I would consider a very common, useful function) required me to write 1182 lines of code and create 13 DAO’s. All that and I still do not know if I have satisfied all the business rules in the code. For all I know, I’m putting the database in some sort of wacked out state that will bite me later down the line… hope not.

    I would like to see the code cleaned up in such a way that there are a few specialized controllers which provide functionality with a clean interface. I’d also like to see fewer beans. In fact, I think it would be awesome to get rid of a lot of the support code and concentrate on the main goal… clinical studies.

    I think one way to achieve this code cleanup is though using some common java frameworks. I have chosen spring and hibernate as my frameworks of choice only because they seem a natural fit to my coding style. I fought with struts for a few months when I was at a web development company 4 years ago… I didn’t agree with strut’s methodology?…. Can’t think of the word… It just didn’t seem right.

    I sat down with Spring for a half day and was blown away with how productive it allowed me to be. I could concentrate on my business and leave the infrastructure to the spring development team.. amazing. As a counter point.. I’m sure there are a ton of people who are more comfortable with struts than spring for the same reasons.

    I feel the same about hibernate. I just like it. And, the fact that it will generate code and database schema automatically is a big plus. I like writing software that writes itself.


    At any rate, I can’t emphasize any more how important I think it is to leverage frameworks to make code more concise and maintainable by a larger population.

    I wish I could get into some sort of front-end framework like JSF or tapestry.. sadly, I haven’t taken the time to learn any and therefore my jsp pages are an absolute mess.


    Any thoughts?




    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
    Sent: Friday, January 20, 2006 10:59 AM
    To: [email protected]
    Subject: RE: [Developers] first post.

    Hi Jordan and Shai,

    You both raise very good points about incorporating frameworks into the OpenClinica code. Jordan, some of us had also previously been discussing the idea of using Struts Action to take over for our control servlets, do you have any experience with either Struts package (Action or Shale) and how they stack up against Spring? What are some of the tradeoffs?

    Shai, you raise a good point about the business logic layer--we had discussed getting Drools to help us with that a little and I had put some stubs of code for a small business-logic class in the code base, they should still be there under org.akaza.openclinica.logic.core.

    Jordan, the regular expression code is in the 1.0 release, and I would certainly like to hear more about the external hooks you were able to put into the system. What application did you use to package them up? Were there issues with security and user validation?

    Cheers,
    Tom

    Tom Hickerson
    Senior Project Coordinator
    Akaza Research
    One Kendall Square, Bldg 400, Fourth Floor
    Cambridge, MA 02139
    p 617.621.8585 x15
    f 617.621.0065
    "Open informatics for public research"
    http://www.akazaresearch.com/
    Sent: Friday, January 20, 2006 10:55 AM
    To: Woerndle,Jordan; [email protected]
    Subject: RE: [Developers] first post.
    Hi Jordan,

    Thanks for your email. Certainly a lot of good ideas in here.

    Porting OpenClinica to Hibernate is certainly a good idea, and I hope to look into that in the near future. >From a code infrastructure point of view, what other ideas do you have on improving the code base? For example, another priority for me is to clean up the Validation class and define a clean interface so that developers can create new validation types by subclassing an abstract ValidationType class (or something like that.) The current class started out as a much more lightweight piece of code, but I think an overhaul is in order.

    Another priority is developing a business rules layer separate from the servlet/form processing layer. Right now there are a lot of business rules running around the application - for example, you can't perform double data entry on a CRF unless a) you did not perform the first round of data entry or b) more than 12 hours have passed since you completed the first round of data entry. This is a good rule, but it's hard to find in the code. It would be nice to put such rules in small, easy to find (and change, if the mood strikes you) classes. We did some research on business rules engines a while back, and at some point I'd like to dust that off and see if we can't work it into the code base.

    Any other thoughts?

    Shai Sachs
    Director of Research and Development
    Isovera.com
    One Kendall Square, Building 400
    Cambridge, MA 02139
    office: 617-621-8555 x 12
    mobile: 617-833-3648
    http://www.isovera.com
    Sent: Thursday, January 19, 2006 4:56 PM
    To: [email protected]
    Subject: [Developers] first post.
    Hi there,

    I’m glad to see the developer’s mailing list up and running. Tom asked me to start a thread on how I integrated beanshell to support scriptable actions on individual items. I’d be happy to explain if anyone is interested. In fact, let me know if you’re interested in my implementation of:

    Regular expression data entry validation (is that included in the 1.0 release?)

    BeanShell scripting for data entry validation (ranges, data types, calls to external sources.. pretty much anything you can think of.)

    External hooks to create subjects and events in response to external events. I built a client app that packages data and ships it to our server. OpenClinica can pick the data up and create/populate new events. It will also notify people that new events are ready for review.

    As a side note, does anyone want to port openclinica to use spring/hibernate/acegi? Why? Well, I couldn’t bend OpenClinica to do something we needed so I spent the last month building something from scratch. I built similar features into my new app with about 530k of source code (including jsp’s) and configuration. My last count of open clinica source is 4 MB and about 2MB of jsp’s.

    Jordan


    The materials in this e-mail are private and may contain Protected Health Information. If you are not the intended recipient be advised that any unauthorized use, disclosure, copying, distribution or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone at 314-747-8162 or by return e-mail.
  • Jun XuJun Xu Posts: 20
    Hi Scott,
    Thanks for your input! Actually we do have a SQL repository, which is based on apache digester package . Bascially we put all the SQL statements inside XMLs, then use digester package to retrieve the desired SQL from DAOs. (And I just found that iBATIS can do this work! ) If we decide to use hibernate, we may still have a lot of HQLs instead of SQLs inside XMLs, since OpenClinica has a lot of large queries for reporting.

    I don't have much experience on iBATIS, it looks like a similar package with Hibernate? iBATIS maps Java Objects to the results of SQL Queries, whereas Hibernate maps Java Objects directly to database tables, traditional Object-Relational Mapping. Found some comments on the web, "compared to Hibernate, iBATIS is more flexible, has a shorter learning curve, but can take more time to develop and maintain, since you have to write all your queries and if your object model changes you have to go through all your queries and make sure to make all the necessary changes to reflect the changes in your object model. " "The performance of Hibernate (especially when dealing with large datasets) is VERY overrated." Currently we need to work with large data sets, and a few queries have outer joins and nested subqueries, which are not very good for hibernate. I'd like to know more about your experience on iBATIS, particularly on performance.

    -Jun
    From: Scott Li [mailto:[email protected]]
    Sent: Thursday, February 09, 2006 2:38 PM
    To: Jun Xu akazaresearch.com; [email protected]
    Subject: Re: [Developers] Code Base Improvement
    Hi, Jun,

    This is Scott Li from Thomas Jefferson Univ. I think nothing is blocking you from using SQL if the only need here is to avoiding SQL Statement inside Java code. Two ways you can avoid this:
    1. Use iBATIS and DAO.
    2. Implement a SQL repository, from which all SQL statement retrieved based on its ID.

    For the second solution, we have implemented a MBean Service, serving as a SQL repository on top of iBATIS, which make the local database access transparent to your applications. Inside this framework, you split developer and DBA's role, each focus on their own expertise. DBA just focus on repository part, developers focus on business logics.

    I am not sure if this is what you are looking for...

    Also I am interesting to know how open your project is, interested to know if Jefferson can join as part of the project, we have our legacy clinical trial systems here that needs to be in caBIG in the future. Recently we are put together a proposal for the Clinical Trial Calendar. Is openclinica an caBIG compliant software, how about the BRIDG model?


    Scott
  • I cannot compare iBATIS with Hibernate because I really didn't get chance to run a performance profiling. But for complex sql join and larget dataset, I won't recommand to use mapping due the generated sql may not efficient. Writing your raw SQL to improve performance in this case does make sense, but there is tradeoff as you mentioned. So hashed SQL in iBATIS won't be a problem as far as I can see, performance hit in this case may really be caused by the business layer design. I don't see the validation of model change, if model change, anyway, no matter what you have to go through your files to fix things, really depending on how frequent the changes can be...in a team with proper communication between DBA and developers, this should not the biggest issue.

    Scott
  • An interesting thread on iBATIS vs Hibernate is posted here:

    http://raibledesigns.com/page/rd?anchor=hibernate_vs_ibatis

    Also found a tutorial that contains iBATIS:

    http://www.learntechnology.net/struts-spring-ibatis.do

    After skimming these two docs, it looks like iBATIS is something to consider, since Jun pointed out that we do have large datasets that involve a lot of joins. Aside from technical issues, however, has anyone embraced iBATIS in the clinical research space? For example, Scott mentioned the caBIG standard, would iBATIS be acceptable to them, or are they only willing to certify applications using an ORM-only solution?

    Tom
    Sent: Thursday, February 09, 2006 4:55 PM
    To: Jun Xu akazaresearch.com; [email protected]
    Subject: Re: [Developers] Code Base Improvement
    Hi, Jun,

    I cannot compare iBATIS with Hibernate because I really didn't get chance to run a performance profiling. But for complex sql join and larget dataset, I won't recommand to use mapping due the generated sql may not efficient. Writing your raw SQL to improve performance in this case does make sense, but there is tradeoff as you mentioned. So hashed SQL in iBATIS won't be a problem as far as I can see, performance hit in this case may really be caused by the business layer design. I don't see the validation of model change, if model change, anyway, no matter what you have to go through your files to fix things, really depending on how frequent the changes can be...in a team with proper communication between DBA and developers, this should not the biggest issue.

    Scott
  • caBIG should not block us using persistence layer technology. The model and semantics integration doesn't specify that we must use ORM. ORM just happened to be one of the artifact of the caCORE SDK process. So, my thoughts to this is that both silver and gold compatibility still hold with any persistence technology. The only issue for different application provider is to think of how to follow on the track to have the semantics integration sorted out, then figure out a way how to expose the sharable part of the application out inside grid. In terms of how to do this, caBIG domain really need new bridging tools to fulfill this goal.

    Scott
  • BTW, who are the adopters of this openclinca project. If possible, Jefferson is interested to get involved in the process, kind of feeling that this project is going to be a caBIG compatible one in the future??

    Scott
This discussion has been closed.