10 tips on how to prevent business value risk
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Werner Schuster on Aug 16, 2007
We have developers in mind that want the productivity and other advantages of Rails, but that already have invested in a Java domain model or for some reason need more than Active Record. Examples are composite keys, legacy databases, prepared statements, complex class hierarchy mappings or Hibernate's first and second level cache. To make that possible we will have to provide an interface that follows the active record pattern without compromising access to the full power of Hibernate.
Initial focus was on mapping Ruby objects. Charles Nutter suggested that existing Java classes should be kept in mind as well. At its bare minimum you can write pure Ruby classes with attribute accessors and create the usual Hibernate mapping files by hand. There are already some tests in the Subversion repository showing just that. Working with the XML mapping files directly is obviously not very Ruby-like, so a DSL is underway.
There are two DSL-like things we can (and will) do. One form embeds the mapping information in the Ruby class definition. Ola Bini (who else?) has sent me a patch with some (meta)programming magic, which allows to write things like this:
class Project
include Hibernate
table_name = "PROJECTS" #optional
primary_key_accessor :id, :long
# column names are optional
hattr_accessor :date, :timestamp, :START_DATE
hattr_accessor :name, :string
hattr_accessor :complexity, :double
hattr_accessor :size, :long
hattr_accessor :on_schedule, :boolean
end
By including the Hibernate module (as opposed to inheriting from a framework base class), the Hibernate mapping is generated and configured automatically. Utility class methods (like "save" and "find") and accessor methods for the mapped properties are also added. Please note that this is a first working draft and we still welcome suggestions. This code will be in the repository real soon.Johan explains what would be involved for a port of ActiveHibernate to .NET, IronRuby and NHibernate:
The other form keeps the mapping info separate from the Ruby (or Java) classes to keep these completely peristence ignorant. No work has been done on that yet.
The IronRuby/NHibernate combination seems like the most natural candidate. IronRuby is still in pre-alpha, but from what I have seen it will be possible to do something equivalent to the JRuby Java extension we did for Activehibernate. The NHibernate part, however, will be harder. NHibernate 1.2 is based on Hibernate 2, with a lot of Hibernate 3 goodies ported back. Unfortunately ActiveHibernate is based on new Hibernate 3 features (e.g. tuplizers, added to H3 to support dynamic maps and XML serialization) that haven't been ported to NHibernate (yet?). So it all depends on the roadmap for NHibernate. Anyway, it will be possible to share almost all the Ruby code that makes up ActiveHibernate (in the case we'd do a port).
ActiveHibernate is something I do in the evening, but I guess we should have something really usable and complete within one or two months time. Of course, it could go much faster if other people join in with ideas and patches (like Ola already did). People can already check out the code on http://code.google.com/p/activehibernate There's a readme file and a Rakefile, so that you can build and run the tests without much hassle. (But please keep in mind it is still early days.)Johan also blogs about the progress of ActiveHibernate.
18 agile and lean practices for effective software development governance
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
NOSQL, The Web And The Enterprise
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.
John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.
Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.
Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.
Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?
Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.
2 comments
Watch Thread Reply