PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: mico on February 19, 2010, 04:56:35



Title: Where would you place X?
Post by: mico on February 19, 2010, 04:56:35
Hello,

I would like to know where do you usually place such classes as extended Notifications or class of constants for a specific View Component. Should they fall into model or view directories or they shouldn't be littered with these classes?


Title: Re: Where would you place X?
Post by: puremvc on February 22, 2010, 07:36:25
If there are constants for a specific view component, I usually define them on the component itself. The only other actor that should know or care about the API of the view component will be its Mediator, so it is reasonable for the Mediator to refer to these constants defined on the component itself.

I never extend Notification, since it would require me to use facade.notifyObservers instead of the sendNotification convenience method on all Notifiers. If I did extend Notification, I'd define the classes in a 'common' folder same folder sibling to the the 'model', 'view' and 'controller' folders (for a standard version app).

-=Cliff>