-2

How can we implement MVC 4 concept in coldfusion The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller.

tereško
  • 58,060
  • 25
  • 98
  • 150
rique
  • 237
  • 1
  • 3
  • 7
  • @tresko changed your mvc tag to asp.net-mvc-4 which I suspect is incorrect, does this question have anything to do with asp.net's implementation mvc? ie. have you used it before, are you migrating or trying to emulate it? – genericHCU Apr 01 '13 at 11:25

2 Answers2

5

There are a number of MVC frameworks avaiable in ColdFusion. There's no need to roll your own. Here's a selection:

I've used ModelGlue and quite liked it. I've tinkered with FW/1 and it'll be my framework of choice next time I start a project, and I have done one project with ColdBox and it's a bit too heavy for my liking. That said, a lot of people really sing the praises of ColdBox, so don't necessarily take my word for it.

The best thing to do is to have a google around the place to see what people are saying, and just give them a go.

ale
  • 6,369
  • 7
  • 55
  • 65
Adam Cameron
  • 29,677
  • 4
  • 37
  • 78
0

While CF is primarily a tag based language, it is a language whose tasks and operations are amenable to a Model/View/Controller architecture (MVC) and do so in an object oriented environment. Naturally, you can build an application with or without OO and MVC features. People whose development career started with CF tend to be more comfortable building apps without such frameworks and such while those who come to CF from other development languages seem to be the ones who are more comfortable with such things.

Either way, there is no single best way to implement a MVC architecture in CF. There ARE, however, a number of MVC frameworks that are agreeable with CF or were even developed with CF in mind. Those are:

  • CFWheels
  • Fusebox
  • Model-Glue
  • ColdBox
  • MachII
  • FW/1

Personally, I've been comfortable for years working without frameworks that apply a strict MVC architecture but I've also seen how they can be useful in cases. In addition to these commercial efforts, developers can and do "roll their own". The thing to keep in mind for all these frameworks is that they're taking advantage of CF's native OO capabilities but, in simple terms, they're using a series of CFINCLUDES to pull in the control, the data manipulation and the presentation layer.

In any event, have a look at those and see if any appeal to you. I've heard good things from other devs about FW/1. I'm told it's lightweight and doesn't impose an undue burden on your CF dev (whereas other options like Fusebox and ColdBox certainly can).