Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: AppSkeleton not conform FAQ?  (Read 13594 times)
jerry
Newbie
*
Posts: 1


View Profile Email
« on: October 31, 2008, 08:33:39 »

I am starting a new test project to get the feel how PureMVC is working in a development environment.

So I was reading the FAQ particular this article ( http://puremvc.org/content/view/93/188/ )
It is stating:
Therefore, the Model tier (Proxies) should not reference anything specific to your Controller/View tiers or your ApplicationFacade/ApplicationConstants.

While the ApplicationSkeleton Demo is doing that inside the ConfigProxy, LocaleProxy and the StartupMonitorProxy.

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: November 02, 2008, 05:25:46 »

True, it does this and shouldn't. This was pointed out and I thought the author was fixing it, but I haven't heard back on that in awhile so I'll ping him again about it.

Thanks and good catch!

-=Cliff>
Logged
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #2 on: November 06, 2008, 10:24:05 »

Proxies shouldn't access ApplicationFacade constants?
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: November 06, 2008, 04:46:41 »

@joel, No, they shouldn't. Think of the Model as the crown jewels of your app. If the Model is free of any coupling to your application, then you can use it in another application.

This is a particularly important thing to keep in mind with Flex and Air. A common model could be reused in both, but the use cases of the actual apps might be quite different.

It is the reason in life for the View and Controller tiers to present and expose ways for the user to update the Model.

The Model should not be concerned with the business of the other two tiers or to the concrete Facade which is also specific to the application.

-=Cliff>
Logged
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #4 on: November 07, 2008, 07:25:37 »

It makes sense now that I think about, but makes me sad because everything I have written violates this principle ;)

Now where did I put my "can't talk refactoring" hat...
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: November 07, 2008, 07:49:02 »

Well, its not really such a big deal, and something that is easy to refactor should you ever need to reuse your model elsewhere.

-=Cliff>
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #6 on: November 07, 2008, 07:56:52 »

It makes sense now that I think about, but makes me sad because everything I have written violates this principle ;)

Now where did I put my "can't talk refactoring" hat...

I have to admit that I break this rule too. I use Constants from my App definition all over my proxy's for notifications :(
Logged
marek
Jr. Member
**
Posts: 14



View Profile WWW Email
« Reply #7 on: November 07, 2008, 08:14:25 »

interesting...
Logged
danieleUg
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #8 on: November 10, 2008, 06:33:16 »

Hi jerry,
good catch!
I will commit the fixed version in the next days.

@Cliff: About the use of constant in Proxy we have to stick the FAQ, but I found usefull to define the notification constants in the proxy for a couple of reason:

- if the proxy can used in more projects, I have to move less files, in the case of ConfigProxy I must to move only this file. Otherwise if I have more proxies that are reused in differents projects, for each proxy I have 2 classes: one for the proxy and one for the constants.

- if the notification is send only from proxy and the other tiers listen it, I found convenience to define in the  proxy this will help me to understand the notification role, if is defined in ConfigProxy I know that is something about Config. I found it usefull when I work in a team.

Best
  Daniele

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #9 on: November 10, 2008, 07:15:16 »

@Daniele,

Defining constants in the Proxy is good. Using them in the Proxy if they have been defined in the ApplicationFacade is bad, because it makes ties the Proxy to that application. Or it must be defined in the ApplicationFacade of the app you reuse it in. So the logical place for any constant related to a given Proxy is in the Proxy itself.

-=Cliff> 
Logged
Pages: [1]
Print