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
|
|
|
Show Posts
|
Pages: [1] 2
|
2
|
Announcements and General Discussion / General Discussion / Business logic in Controller
|
on: March 26, 2012, 03:08:26
|
Hi Forum During my reading about MVC, I encountered a term that I found interesting. The term is Fat Stupid Ugly Controllers (FSUC). It belongs to Padraic Brady, who is pretty famous in PHP community. He has a pretty cool book about Zend framework, and he wrote a chapter about MVC http://bit.ly/GQrmwJ . His idea is that controllers should be as thick as possible and our business logic should be in the Model. In PureMVC we have a separation for Business Logic and Domain Logic, and the best practice is maintaining BL in the controller and the DL in the model. So I have two question: 1 - Is PureMVC using a different approach to Controller role, different from classic MVC? 2 - Is the reason for it is AS3, and the fact that the language is multiplatform? Thanks, Eli
|
|
|
3
|
Announcements and General Discussion / General Discussion / Re: Transient proxies question
|
on: January 24, 2012, 01:55:15
|
Just to clarify. Let's say that I have a number of asynchronous actions A,B,C,D,E,F. In my application, I have a lot of places like:
after A ended { if (B started) { start C; } }
So I should create a transient Proxy that will hold AsyncActionsVO that will have public properties for each state? That means that after user's action and after some asynchronous action ends, I will make the check in the commands?
|
|
|
5
|
Announcements and General Discussion / General Discussion / Re: PureMVC for games
|
on: January 16, 2012, 02:07:05
|
4ucai
Yes PureMVC is viable for developing games. It is viable for almost any large scale project that you will have. That being said, you might also want to check frameworks like PushButton or Flixel, for rendering complicated graphics and maybe some of the game logic. PureMVC does not handle the work with complex display list.
|
|
|
6
|
Announcements and General Discussion / General Discussion / Re: One notification - multiple actors handling it
|
on: January 15, 2012, 02:22:45
|
This is great concept Cliff. I found it in the book too. In this case, should I unregister the proxy after I use it?
The thing is that this process is naturally happening a lot, so I will have to initiate it a lot of times. So shouldn't I instead have an instance of this proxy all the time, and just change the data when needed?
For example, continuing the example you gave:
var startHow:String = facade.retrieveProxy(AppConstants.START_ACTION).getData() as String; handleStartAction(); facade.registerProxy(new Proxy(AppConstants.START_ACTION, AppConstants.IDLE) );
This way I will be able to know what is the status of the game all the time.
|
|
|
7
|
Announcements and General Discussion / General Discussion / Re: One notification - multiple actors handling it
|
on: January 12, 2012, 03:57:38
|
Thanks Cliff That makes me wonder though: Avoid retrieving a Mediator from a Command and operating on it. Shouldn't commands handle the business logic of the application? Sometimes mediators hold the information that command needs. For example, let's say we have two buttons in our veiw - 'start' and 'start_and_jump'. Both of them are firing the same notification ANIMATE_BEFORE_START, which will start an animation in different view component. After the animation ends I will fire "START_GAME" which will invoke "START_COMMAND". In the "START_COMMAND" I would like to be able to know whether I should jump or not after I start, so my solution is to ask the initial mediator about what happened. Naturally the perfect solution was to have 2 different notifications, or to pass an additional parameter with the notification, but sadly I can't do it in this case, since the actions are asynchronous.
|
|
|
11
|
Announcements and General Discussion / General Discussion / Basic terminology question - Business Logic, Domain Logic and Domain Model
|
on: January 06, 2012, 04:23:55
|
I am reading the "ActionScript Developer's Guide to PureMVC" right now, and also trying to get some help in the Best Practices document and this great forum. At this point, I start to realize, that in order to truly understand PureMVC, there are number of key terms that are needed to be figured out. The problem is that I'm not sure there is a precise definition for some of them(at least not in the context of PureMVC). For example, what is the accurate definition of Domain Model? This term is being used in both documents. Is Domain Model similar to Model from PureMVC? Also, I think that I understand the difference between Business Logic and Domain Logic, but how are they connected to Domain Model? The best practices document says: Commands house the Business Logic of our application; the technical implementation of the use cases our application is expected to carry out against the Domain Model. This involves coordination of the Model and View states.
but the next paragraph says: The Model maintains its integrity through the use of Proxies, which house Domain Logic, and expose an API for manipulation of Data Objects.
So I am confused, Business Logic represents the use cases, which are the Domain Model. But why Domain Logic is not related to Domain Model?
|
|
|
13
|
Announcements and General Discussion / General Discussion / Re: Mediator having a reference to a view
|
on: January 03, 2012, 09:09:06
|
Hi Cliff A) Have A_View's parent in the display list encapsulate interaction with A_View (i.e. expose a method that SystemMediator can call and have that method do the interaction with A_View) B) Mediate A_View and then A_View's mediator can make calls to A_View's methods and set its properties.
Can you explain what do you mean in B? What do you mean by "mediate A_View"? As I see it, A_View's mediator always can make calls to A_View's methods. I guess I'm saying that I don't see the difference between A and B. Eli
|
|
|
14
|
Announcements and General Discussion / General Discussion / Proxy related logic in the command
|
on: January 03, 2012, 03:01:31
|
Let's say I have a proxy, with some properties in it. And I have a command that has to access the API of the proxy, depending on some logic related to the properties of the proxy. Where should I have all the logic, inside the command, or inside the proxy?
For example:
if (myProxy.a > myProxy.b) { myProxy.foo() } else { myProxy.foo2() } or just
//figureFoo compares myProxy.a and myProxy.b and calls the relevant function in myProxy myProxy.figureFoo()
The reason I am asking, is that the logic is pretty complicated, and I want the proxy to be clean.
|
|
|
|
|
|