← Back to team overview

launchpad-dev team mailing list archive

do we have guidelines on what goes in model, and what in browser?

 

I've looked on the dev wiki, but found no useful pages in a full text
search for 'model browser' :)

The reason I ask, is that it might make things a little simpler for
reviewers and developers if there were some generally expected
guidelines.

Not that the guidelines are large: the core of it is 'rendering and
marshalling code should be in browser/, querying and mutating code
should be in model/'.

The reasons for suggesting that as the guideline:
 - code in the model can be exposed on the API
 - code in the model can be declaritively secured
 - we don't need to do html rendering and other browser-connection
logic in the API

so separating out 'could be used in the API' into model/ nicely
decouples the two - and allows testing the core functionality without
html parsing etc.

However, perhaps I'm fundamentally confused here and we already have
strong guidelines - perhaps ones that disagree with this proposal -
that I overlooked? In which case, point me at em!

-Rob



Follow ups