Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Spring/Hibernate config design question

Thread Tools

Spring/Hibernate config design question

Posts: n/a
I have a series of Rule classes that are mainly behaviour. I generally need
just one object of each class.
They all inherit from a single superclass and are at present persisted as
@Entity through Hibernate.
I would like these rules to be configurable through Spring such that I may
have where neccessary more than 1 object per class. But the config state is
so disparate it won't fit neatly into the Hibernate inheritence persistence

I'm thinking of just storing Spring Bean Ids for the Rule classes (as
properties in place of the original foreign key) via Hibernate then using
Spring to instantiate the Beans from this name and pull out config
properties from bean xml. If the bean definition does not exist then some
sensible default can be created and a Class.newInstance() performed.
I suppose I'd mark the Rule attribute as @Transient and lazily instantiate
it on request.

Does this sound like a decent plan?

Mike W

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
class design/ design pattern question Bartholomew Simpson C++ 2 06-12-2007 08:51 PM
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
"copy running-config startup-config" simultaneously Cisco 4 03-10-2005 06:04 AM
OO design in servlet design question dave Java 5 07-17-2004 12:58 PM
Default Config Files or Basic Config Steve Marshall Cisco 2 11-05-2003 10:25 PM