Puakma: Under the hood

I'm Brendon Upson, jack-of-all-trades, master of one or two. I'm talking about life running a small ISV tackling business issues and leaping technology hurdles in a single bound.

webWise Network Consultants is based in Sydney, Australia and develops the groundbreaking Puakma server technology.

Misc

The Model View Controller Model (MVC)

Filed under: by Brendon Upson on 09:48

MVC is the architecture espoused by all and sundry as the epitome of "proper" development. Conceptually it makes sense. The reality falls a little short.

We were discussing the relaitve merits of different application servers here at WNC the other day and discovered that although we strive to separate the visual stuff from the business logic, there is always some overlap. J2EE, as an example, has JSPs and servlets as the main two application design components. The servlet is normally used for logic and heavy lifting (let's not talk about EJBs in this context, as few people actually use them) while the JSP provides the visual layout. Problem is you can poke layout into servlets and (more dangerously) you can poke logic into JSPs.

I've never been a fan of JSPs purely because the ugly mix of html markup and Java code all in the same file. For this reason we went with p-tags in pages in Tornado server. The p-tag simply denotes a field you have no ability to put any kind of server-side logic into Pages. Actions are a little less clear and are most like servlets (or web query open agents in Domino). In Actions there is the ability to blur the line between presentation and logic.

It's all about compromise. I think we strive for perfection but always have to compromise at some point between delivering the solution and coming up with the perfect logical design. The difference between a good and bad system is where that compromise point occurs.

Comments

  1. You'll always need some sort of logic in your view layer unless all you're doing is just displaying simple forms/results. What about when you need to show/hide a section of the page dependent on a value in the model, or loop through a collection of model objects to display a list?

    Like with most things it's about discipline in order to not do things in the view layer you should be doing in the other layers.

    Comment posted by Marcin Szczepans on 2006-02-09 09:07:02.0 | mail

Your comment

Protected from spambots!



HTML is allowed
Formatting: Basic formatting can be included like so:
[b]bold[/b] and [i]italic[/i]