Where's the "M" in MVC?

12 views
Skip to first unread message

Caleb Barr

unread,
Sep 13, 2010, 3:13:21 PM9/13/10
to limelight
Hi all,

I don't exactly know how to map the limelight framework to a regular
Java swing project (not that I'm an expert in Swing.) Where do I put
the model? For example, I need an array that gets iterated through
(based on user input) and feeds that information to the views (the
props, in this case?) Where does that go, and how do the views access
it? I think I understand the controllers and events here.

Thanks, and sorry if this isn't clear,

Caleb

Micah Martin

unread,
Sep 13, 2010, 4:42:14 PM9/13/10
to limelig...@googlegroups.com
Hi Caleb,

For simple stuff, or just to get started, put the logic in the Players. Players can hold on to data and play for the role of a model to some extent. However, for any significant production, all the business logic should exist outside of the Limelight code, in which case the Players just act like connective tissue between the model and the UI.

For an example, checkout the hangman production: http://github.com/slagyr/hangman/tree/master/hangman/

You'll see that all the business logic source code lives in 'lib' directory. The production loads up all the business logic needed by the production as can be seen here: http://github.com/slagyr/hangman/blob/master/hangman/production.rb. In the DefaultScene Player (http://github.com/slagyr/hangman/blob/master/hangman/default_scene/players/default_scene.rb), all the code if UI related and the real work is delegated to the business layer.

Does that help?

Micah

Caleb Barr

unread,
Sep 13, 2010, 4:51:15 PM9/13/10
to limelig...@googlegroups.com
I'll check this out and get back to you if I have further questions.  I appreciate you following up on this!
Reply all
Reply to author
Forward
0 new messages