Lots of mvc implementations include accessor methods at the top level
(convenience methods).  There are no rules, really, so there's nothing wrong
with this.  The mvc is just there to help you organize the application, and
to maintain it later.  It's meant to keep code where it belongs.  That said,
it can often do more to obfuscate than help... but that's another story...

So there's nothing wrong with MusicPlayer.addPlaylist...

Jim Kremens


On 8/29/06, Martin Wood <[EMAIL PROTECTED]> wrote:

> So I was wondering what the best method may be to access the model to
add a
> playlist.
> Some say the best way is to create a wrapper function to the MusicPlayer
> class, that simply runs the method of the model. But then I need to
create
> extra kinda useless functions in the MusicPlayer class.
> So what would you guys do?

I would add the 'useless' functions :)

dont worry about their content, focus on the API that you are presenting.

If im using your music player and i see

MusicPlayer.addPlaylist

its obvious what its for and i'll happily use it. I dont care if it just
delegates to the model without doing anything else. Im quite happy not
even
knowing there is a model. :)

Of course you could choose to allow the client code to access the model
through
a MusicPlayer.getModel but you probably dont need to expose that much of
the
internals.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Jim Kremens
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to