Frameworks vs. Services: On choosing the right approach
Recently there was some discussion about the CAB during which I think we found the core difference between the CAB approach vs. some of the OSS tools that were brought up in the discussion (sorry, I can't recall who first brought up this observation).
Frameworks has a much higher adoption cost associated with them vs. services. Services are more easily compassable and replaceable. The general option is that services == Often Good, Frameworks == Sometimes Good. Feel free to shift the scales every which way you want, obviously I am leaning toward the services over frameworks, but others has different approaches.
So, given this, how do you explain the success of Ruby on Rails? Isn't it a big framework?
Well, I don't see RoR as a framework, it is a Framework Skeleton, and filling this skeleton there is a set of independent services that can be used to build your application. This approach means that you can:
- Replace the services with your own implementations
- Use the services outside the framework
This means that if you really liked the logging component in the framework, you can pull it out very easily and start using it, without having to drag the rest of the framework in.
Comments
Here's where I'm still a little ignorant, and would like to know something.
Like most people (or some anyway), when I first heard about it, I went to some post or blog or site or something and got a basic 'starter kit' or tutorial, and walked through a sample.
A whole bunch of directories were created for me, etc. and was basically given an MVC structure. IIRC.
I didn't like the MVC structure.
Can I use ROR and put in my own MVC structure? I simply don't know.
For that matter, can I use Monorail and put in my own MVC structure? From looking at the docs, I can change what the view technology is (in theory, WebForms doesn't look promising, and nVelocity didn't look to me to be updated in a long time), but can I decide to hand roll my own Presenter implementation, my own view implementation and my own Model implementation?
I know I can hand roll my own MVP implementation with Asp.NET web forms. Are ROR and/or Monorail highly configurable in that regard?
TIA.
@jdn,
RoR will direct you at the best practices point, but you can definitely do it your way if you want to.
About MR, yes, absolutely, you can change basically everything.
Oh, and the NVelocity view engine is continuously updated.
If I go to:
http://nvelocity.sourceforge.net/
the last update it has is 2003.
How is that 'continuously updated' or has it moved?
I completely reject the idea that RoR directs anyone at best practices, but that's an completely different discussion.
jdn
MonoRail is much more configurable that RoR in my experience.
I was put off by how RoR literally forces you to stay on a specific path. Once you deviate from the way it is designed, you very quickly go downhill.
jdn,
NVelocity was forked, it is now handled entirely in the Castle codebase.
Bob,
MR puts a significant emphasis on being non opinionated, RoR seems to goes in the other direction.
Oren
It sounds like you have a different definition of framework than the rest of the world. Take the wikipedia definition for example...
"A software framework is a reusable design for a software system (or subsystem). This is expressed as a set of abstract classes and the way their instances collaborate for a specific type of software (Johnson and Foote 1988; Deutsch 1989). Software frameworks can be object-oriented designs. Although designs don't have to be implemented in an object-oriented language, they usually are. A software framework may include support programs, code libraries, a scripting language, or other software to help develop and glue together the different components of a software project. Various parts of the framework may be exposed through an API"
There's also the more simplified and famous Hollywood principal that is "Don’t call us, we’ll call you."
By this definition CSLA, CAB, SCSF, ROR and even Monorial are frameworks!
The definition of services is still a framework. It may be a specific type of framework with a defined scope, but it is a framework never the less. It's high time we use the definition itself to decide what is and what isn't a framework.
Now I am not saying a services framework is a bad idea. I like the idea of being able to "opt-out" and "opt-in". ROR certainly does not let you "opt-out", nor does Monorail from what I have seen. They may operate in a different way than CAB, potentially a far more simplified manner, but they still require you to "buy in" to the story. In our next version of the web client we are planning to make end roads in the "opt-in", "opt-out" approach. Our goal is to have the new functionality in WCSF v2 able to plug right into an existing application without that application needing to be built in or on top of WCSF.
"When I use a word," Humpty Dumpty said in rather a scornful tone, "it means what I choose it to mean, neither more nor less."
Confusing, I agree.
I don't really subscribe to the definition that you quote. Would it make it clearer to say that I am thinking about monolithic frameworks here?
I have little experience with RoR, but in MR, the only thing that you really need to keep is the MVC part, and if you really like, you can make aspx code behind the controller as well, but then I'll have to shoot you.
What is the buy-in scenario for log4net?
Hi Oren,
I don't think that you are right this time
Both RoR and CAB are frameworks since they (unlike libraries) call your code (see for example a post I made on the subject last year http://www.ddj.com/blog/architectblog/archives/2006/07/frameworks_vs_l.html )
I think the difference is that what you call framework are monolith frameworks which are more coupled vs. what you call services which are componentized and more loosley coupled frameworks
Arnon
Arnon, I would accept this correction, I was referring to monolithic frameworks, but I don't think that framework as it stands right now has a meaning, that is why I am using framework skeleton
Isn't the difference between the concept of a "framework" and the concept of "services" the fact that using services allows you to pick and choose the "best of breed" of each, whereas using a framework means you're all or nothing?
CAB and SCSF are frameworks. EntLib is a framework, but you can still pick and choose which AppBlocks you want to use. Even Castle is a framework, because everything essentially depends on Castle.Core, and the MicroKernel. (Unless I'm mistaken, which is certainly possible. :)
Correction: Castle.Core does NOT contain the MicroKernel, just the data model that MK/Windsor uses for injection. My mistake.
Is nVelocity just part of Castle or Monorail? It isn't a separate downloadable thing, correct?
NVelocity is a separate project that is maintained by the Castle team.
But only within the Monorail source code that I can see.
BTW, the build server says the last build was successful, but the details says it failed.
Comment preview