This is an interesting one, as I've been looking for a good excuse to use Hibernate.
Unfortunately annotations won't work in this instance as the core MPXJ object model needs to be independent of persistence, we'd have to write a Hibernate mapping file.
This really now boils down to cost/benefit. The cost is that it will take a relatively high amount of effort to get this working (not that I'm complaining, I'd like to get the Hibernate experience) but we have a working solution now. By going down the Hibernate route we'd add implementation time, plus about 4Mb of additional extra libraries.
On the benefit side, we'd have less code to maintain, just Hibernate configuration, plus I imagine that creation of the Hibernate mapping file would also give us the ability to modify data in the database (update projects, insert new projects, and so on).
I'm tempted to look at this as part of 3.1.0 - I'd be interested in hearing what you think about the costs and benefits - have I missed any benefits?
Jon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
you are quite right in you cost/benefit analysis. the main benefit is you'll get all crud operations and less code to maintain. you also get ability to e.g. advanced caching features or connection pooling. cost is definitely a lot of work to do.
have you ever think about making your code more modular? in my company, there is no need for reading/storing mpp files. we just need to access projects stored in db (I don't even know we are using some C*UD operations now). core mpd source doesn't depend on anything else than just JRE. I would by fine if there exists branch containing just mpd and dependands. if you later decide for another persistent option you can add new libraries just for this module and you can even use annotation on code of this branch.
I hope it is just little understandable. my english isn't so good as I wish.
Vladimir.
Vladimir
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
This is an interesting one, as I've been looking for a good excuse to use Hibernate.
Unfortunately annotations won't work in this instance as the core MPXJ object model needs to be independent of persistence, we'd have to write a Hibernate mapping file.
This really now boils down to cost/benefit. The cost is that it will take a relatively high amount of effort to get this working (not that I'm complaining, I'd like to get the Hibernate experience) but we have a working solution now. By going down the Hibernate route we'd add implementation time, plus about 4Mb of additional extra libraries.
On the benefit side, we'd have less code to maintain, just Hibernate configuration, plus I imagine that creation of the Hibernate mapping file would also give us the ability to modify data in the database (update projects, insert new projects, and so on).
I'm tempted to look at this as part of 3.1.0 - I'd be interested in hearing what you think about the costs and benefits - have I missed any benefits?
Jon
Hi,
you are quite right in you cost/benefit analysis. the main benefit is you'll get all crud operations and less code to maintain. you also get ability to e.g. advanced caching features or connection pooling. cost is definitely a lot of work to do.
have you ever think about making your code more modular? in my company, there is no need for reading/storing mpp files. we just need to access projects stored in db (I don't even know we are using some C*UD operations now). core mpd source doesn't depend on anything else than just JRE. I would by fine if there exists branch containing just mpd and dependands. if you later decide for another persistent option you can add new libraries just for this module and you can even use annotation on code of this branch.
I hope it is just little understandable. my english isn't so good as I wish.
Vladimir.
Vladimir
Housekeeping, closing some old tickets. As MPXJ is primarily file-based there are no plans to work with JPA.