Hi Grant

>> Sure.  The apps that I have created that use AJAX use it to combine
>> - A production Batch
>> -- Its Operations
>> --- Each Operation's Inputs and Outputs
>> ---- Each Output's Storage Instances
>> The best comparison would be something like Windows Explorer with the
>> tree displayed on the left, versus Explorer without the tree.
> 
> Certainly, and I use Ajax for similar uses.  However, from your
> original post I understood that you often found the need to create
> Ajax specific controller actions - and for the above setup I can't see
> that the controller actions should be anything more than the CRUD
> needed for normal HTML views.

In that example what I have found is that I tend to break the 
functionality down into smaller pieces that (for instance) just update 
small pieces of the view, or manipulate sections of the data.

If I am honest about it, I would have to agree that there is a lot of 
what looks like pretty straight forward CRUD in there, so you may well 
be right.

The thing that strikes me though is that to the AJAX interface really 
can't be replicated at all easily with a non-ajax version.  The AJAX 
interface gives a lot of context to the user that is necessary for 
making decisions.  Without that context the non-AJAX version would have 
to supply a lot of extra information for each request to allow the 
interface to be fully re-displayed and the user to see what they needed.

The upshot of this is that my AJAX actions are smaller and less 
complicated than they might otherwise be.


>> Reading the above I got a strong feeling of complexity.  I use Cake to
>> try to speed up my development and maintenance of web applications.
>> Therefore I am very reluctant to complicate things.
> 
> I understand your point of view.  In this case I had two motivators -
> it is still undecided whether this app will have a Flash or Ajax UI,
> and it is likely that a plain text version is also required (for those
> without flash/js).  Also, many of our smaller cake apps fit into this
> - usually having a Flash UI with a HTML admin.  Previously this has
> involved creating almost duplicate controller actions for these two,
> one to render and another to return to flash.
> This new method allows our current app (and any new ones) to support
> all four request types with a minimum of change from "standard cake" -
> just using _response() instead of any render(), redirect() or return
> calls.
> 
> Ack, now it feels like I'm defending it.  Rather, do you have any
> suggestions for a simpler approach?  I agree that it would be simpler
> to keep the normal methods (render, redirect, return), and perhaps
> some kind of post-processor to then decide whether the request type
> actually wants the data in a different format.  Perhaps it would be
> best if any redirects were actually handled through a render call - as
> the RequestHandler already has functionality to change the render
> paths based on request format...

Short answer is no I can't really suggest a simpler way :-(  Given your 
criteria I suspect that a certain level of complication is inevitable 
(just MVC has some inherent complexity).  I almost sounds like you want 
another layer between the Controller and the View that manipulates the 
Controller's output for the requested view.  In a way, this sounds a lot 
like what you are doing already.

I can't imagine that the above has helped you that much! But you have 
made me think too, which is a good thing :-)

Regards,
Langdon

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to