Tuesday, January 03, 2006

Fresh for 2006… ModelGlue for Java!

About a month ago I went down to the DC area to visit with Sean Corfield, Joe Rinehart, Doug Hughes, Scott Boyziod, and a few others, and for some reason Doug and I were talking about his port of ModelGlue for .Net. I don’t know why, maybe for pure masochism, I mentioned that maybe I would be interested in porting ModelGlue to Java. Well Joe though it was a good idea as well, so I decided to give it a go! Over the past month a few people have asked me why I would want to do such a crazy thing, and I do have some reasons! Most importantly, I know a lot of cfers are starting to think about getting into J2EE development, and I know from personal experience, that the initial learning curve, not so much of the language itself, but really of the architecture of J2EE, can stop people in their tracks. Maybe a familiar framework would be a bit of a helping hand? I think so. I’ve done a few J2EE apps and one of the things that I always seem to find myself saying is, ‘man I really like working with mach-ii and modelglue much better that any of these java frameworks’. Struts is too big and too messy for me, SpringMVC is actually pretty nice, but still kind of heavy. For me, I think ModelGlue sits about right for an MVC framework, since it is so lightweight. So I’d like to announce that an early alpha pre-release is not available from svn://clearsoftware.net/clearsoftware.net/ModelGlueJava.

A few notes about this early release:

Spring support is built into the framework, but by doing so, it is currently dependent on the spring distribution. Spring.jar is included in the lib folder of the distribution, along with other dependencies such as commons.beanUtils. An example of defining your controllers in a Spring config file can be seen in the Klondike Records sample app.

I have not implemented asynchronous messaging or session state container support yet, but everything from the current BER of ModelGlue should (maybe) be implemented.

I did make one possibly major, but really semantic change, that I just thought fit better into java. The viewState that you would normally access in views is called eventModel, and is of type EventModel, which extends HashMap. So add(Object key, Object value) and get(Object key) as well as other HashMap methods are available if getValue(String key [, Object defaultValue]) ) is not to your liking. I just really feel strongly that as a user we are dealing with a model object that is tied to the event when setting/accessing values in our controllers and our views. The names have changed to protect the innocent, but nothing more!

Final notes, I’m not done at all! I’m hoping an early preview will gain some interest, and maybe some input and assistance from other java/cfers out there, so have fun, and of course, I’ll be changing things for a while!

6 Comments:

Blogger Bill said...

Very cool Chris. I will definitly keep my eye on this projects progress. It is cool that MG is getting ported to other languages/platforms so quickly.

CF, .NET, Java - any word if there is a php port in the works as well?

3:33 PM  
Blogger Chris Scott said...

Man, PHP would be excellent, and I think very well received. It looks like mach-ii for php is doing fairly well. How about taking it up? I have only dabbled in php and am happy leaving it at that, but MG for PHP would be a fun project and porting a framework is a great way to learn about the its inner workings, as well as the platform your porting it to!

6:03 AM  
Blogger Bill said...

"how about taking it up" haha :O) because I'm lazy :O)

For some reason when I posted the question I figured the answer would be a suggestion. I'll have to think about it.

Having MG available in more languages/platforms would be very handy though. For instance if our company decided to standardize on one framework MG would be a good candidate simply due to it's availability in many of the areas we work (especially with your Java work) - then people could switch projects and jump on board fairly easilly.

How much time do you think you are spending each week working on the Java one? Obviously the translation in PHP is different but it would give me a better idea of how much of a commitment I would be making if I decided to work on it. (I still have a feature I need to do for COAL that I agreed to for Ryan; man I'm a slacker with implementation).

6:42 AM  
Blogger Chris Scott said...

Hmm, tough question. How many hours, well the first week I worked really hard on it and got a tone of work done, I was away for a few days the first week of december, so I probably put a good 30 hours into it. There's no way I have put 80 hours in total though, because it's been a few hours here a few there since then. So, go for it!

7:28 AM  
Blogger Bill said...

hrm, it is a very tempting idea. I'll have to give it some good thought. Maybe I can convince my boss to do it at work :O)

12:29 PM  
Anonymous Anonymous said...

Is this project still going. I havent heard anyting about it. If I could get the old code that would be sweet.

8:52 PM  

Post a Comment

<< Home