← Back to team overview

launchpad-dev team mailing list archive

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

 

On Mon, 2010-12-13 at 08:17 +1300, Robert Collins wrote:
> 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!
As far as I know those are the guidelines we already have, at least
that's how it was explained to me when I first started hacking on
browser code. IIRC the import fascist also used to complain about
importing from database modules directly into browser code.

That said, I can't find any references to such a guideline on the wiki
either. It seems like a good idea to document this.

Cheers,

Jelmer

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References