awkward silence |

Archive for October 7th, 2005

Oct/05

7

Design of a Rails App Cont.

My background is as a web developer and I’ve used most every technology out there. (Really: PHP and Perl, sure, Cold Fusion is ok, but I built quite a large (long gone) community in it’s more obscure cousin Lasso. I always liked WebSiphon quite a bit. If you like pain, give IBM’s Net.Data a go. It certainly wins for nastiest scripting language as a big corporate attempt to glom something together to wire DB2 to the web.)

But now I’m coming to Ruby and Rails from Java, which I’ve used since about 2000. I took a few courses, read a few books and really threw myself into it. I thought when I started that it would be the one I could hang my hat on. OOP looked like the way to go, having gone through a whole lot of huge, contorted code bases.

That’s why I’m a little surprised that one of the most enjoyable and surprising things I’m learning these days is… Object Oriented Programming.

It seems that as you go down the J2EE highway, you find yourself using more and more patterns and creating more and more objects that delegate to other objects. The concept of data + methods is just ripped to hell. We hardly have more than an ejbcreate method on any of our entity beans. And we have thousands of entity beans.

It was in this context that I wrote this post, which said, in part:

Model: only persistence and associations

I got some feedback on the bleak outlook such a decision would have on design. I thought about it and realized that really what I want is a much more robust domain model. Objects that can do things, objects that are not persisted, objects with collaborations. It was such a relief. It may still be that I use mixins to solve the customization for clients issue, but likely they will be mixed in to the model somewhere.

I now move forward by extracting anything from my controllers that could live in the model. I’m doing some CRC cards to find the gaps in my model and flesh it out a bit.

It may be 2000 all over again (when Java looked so promising) but Ruby and Rails sure seems to be a good fit, at least to me. I get a really nice language with just enough of what I need to create full featured web apps without getting to the point of complexity where everything needs to be factored out to flatness.

No tags

Theme Design by devolux.nh2.me