Re: [Catalyst] Program the logic

2006-07-03 Thread Marcello Romani
Brandon Black ha scritto: On 6/29/06, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: If you find yourself putting code in your View templates that isn't directly related to rendering this specific flavour of output, it probably

Re: [Catalyst] Program the logic

2006-07-03 Thread Marcello Romani
Marcello Romani ha scritto: Brandon Black ha scritto: On 6/29/06, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: If you find yourself putting code in your View templates that isn't directly related to rendering this specific flavour

Re: [Catalyst] Program the logic

2006-06-29 Thread Zbigniew Lukasiak
I dont' agree with the statement that all the application logic should go into the Controller. In my opinion in the Controller you should have only the code that is directly web related - all the rest should go into the Model. This way you can call your business logic from a cron script without

Re: [Catalyst] Program the logic

2006-06-29 Thread John Napiorkowski
This response is probably OFFTOPIC at this point, but maybes it's a good type of discussion for our community to have, if we can all be civil about it. Personally I think there are several points of view with the best way to do MVC. MVC, like quite a few programming paradigms offers a simple idea

Re: [Catalyst] Program the logic

2006-06-29 Thread Eden Cardim
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I know is difficult in practice to separate both worlds (logic from the presentation) but that is the false promise of the MVC pattern :). Not really, no, the MVC pattern is actually just a specialized Adapter pattern so you can program

Re: [Catalyst] Program the logic

2006-06-29 Thread Brandon Black
I really don't see much ambiguity myself. I'm not really a theorist on this stuff, so what follows is my practical definitions based on working with it: Model(s) - Data source abstraction. You put things like access to RDBMSes, Files (collections of images?), and even remote data sources served

Re: [Catalyst] Program the logic

2006-06-29 Thread Eduardo Oliveros
Anyway, the question is just what is the best practice to program the logic and test it before link the logic with the web application?. (using the classes generated by the Class::DBI or whatever plugin). I'd stick to the fundamental OO Pattern theory: program to interfaces not

Re: [Catalyst] Program the logic

2006-06-29 Thread Nilson Santos Figueiredo Junior
On 6/29/06, John Napiorkowski [EMAIL PROTECTED] wrote: writing monolythic cgi type applications. Personally I put all the logic having to do with manipulating the database into my model class. So things like adding/removing users or very common searches I put there. Anything that more than

Re: [Catalyst] Program the logic

2006-06-29 Thread Nilson Santos Figueiredo Junior
On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: If you find yourself putting code in your View templates that isn't directly related to rendering this specific flavour of output, it probably needs to be moved to the Controller. Good code in views: iterating an arrayref to generate a ul

Re: [Catalyst] Program the logic

2006-06-29 Thread Brandon Black
On 6/29/06, Nilson Santos Figueiredo Junior [EMAIL PROTECTED] wrote: On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: If you find yourself putting code in your View templates that isn't directly related to rendering this specific flavour of output, it probably needs to be moved to the

Re: [Catalyst] Program the logic

2006-06-29 Thread Zbigniew Lukasiak
Hi, Regarding the generic controller stuff you might look at the Catalyst::Example::Controller::InstantCRUD - you can use it as a base class for your controllers to get the basic CRUD + paging and sort stuff for free. It's still rather experimental though. -- ZbyszekOn 6/29/06, Brandon Black

Re: [Catalyst] Program the logic

2006-06-29 Thread Nilson Santos Figueiredo Junior
On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: The approach I'm attempting lately (and I haven't gotten it all working right yet...) is to make Controller base-classes that implement generic concepts for things like paging and sorting tables of data (complete with handling form args like

Re: [Catalyst] Program the logic

2006-06-29 Thread Matt S Trout
Nilson Santos Figueiredo Junior wrote: On 6/29/06, Brandon Black [EMAIL PROTECTED] wrote: The approach I'm attempting lately (and I haven't gotten it all working right yet...) is to make Controller base-classes that implement generic concepts for things like paging and sorting tables of data

Re: [Catalyst] Program the logic

2006-06-29 Thread Nilson Santos Figueiredo Junior
On 6/29/06, Matt S Trout [EMAIL PROTECTED] wrote: Nilson Santos Figueiredo Junior wrote: That involves doing bad things such as using c.param() from the View but it really was the only practical way (i.e. DRY) I could think of. So, any suggestions are welcome. ;-) No, it's the best

Re: [Catalyst] Program the logic

2006-06-29 Thread Matt S Trout
Nilson Santos Figueiredo Junior wrote: On 6/29/06, Matt S Trout [EMAIL PROTECTED] wrote: Nilson Santos Figueiredo Junior wrote: That involves doing bad things such as using c.param() from the View but it really was the only practical way (i.e. DRY) I could think of. So, any suggestions are

Re: [Catalyst] Program the logic

2006-06-29 Thread Matthieu Codron
Brandon Black a écrit : [...] Controller(s) - This is the glue that binds Models and Views together. It accepts user input, possibly makes modifications to Model data, possibly retreives some Model data, and then displays a View at the user who gave the input. This is where the business

Re: [Catalyst] Program the logic

2006-06-29 Thread Nilson Santos Figueiredo Junior
On 6/29/06, Matthieu Codron [EMAIL PROTECTED] wrote: This does not matter much in most cases except big projects where business logic elements are reused in various situations around the application. Then you put that logic in external regular Perl modules and make your controllers just use

Re: [Catalyst] Program the logic

2006-06-29 Thread Matt S Trout
Matthieu Codron wrote: Brandon Black a écrit : In J2EE projects, the layer model is more like MSCV-I, for Model -- Service -- Controller -- View, the I standing for Integration layer (Spring for example, or Catalyst in Perl) What is missing in Catalyst is that Service layer. But it's not

Re: [Catalyst] Program the logic

2006-06-29 Thread John Napiorkowski
to worry about designers messing up the TT code. --john - Original Message From: Matt S Trout [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Friday, June 30, 2006 7:29:13 AM Subject: Re: [Catalyst] Program the logic Matthieu Codron wrote: Brandon

[Catalyst] Program the logic

2006-06-28 Thread Eduardo Oliveros
Hello all, I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. What is the best way to do it? (some philosophical remarks :)) What I see is that what Catalyst calls Model is just the Objects that map

Re: [Catalyst] Program the logic

2006-06-28 Thread Nilson Santos Figueiredo Junior
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning to program the logic of the application (the Model in MVC) previously to start with web page and the presentation. Actually, the Controller is what is supposed to drive the logic of the application. The model is really just

Re: [Catalyst] Program the logic

2006-06-28 Thread Eduardo Oliveros
That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]: On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: I'm planning

Re: [Catalyst] Program the logic

2006-06-28 Thread John Napiorkowski
, 2006 5:11:27 PM Subject: Re: [Catalyst] Program the logic That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos Figueiredo Junior [EMAIL PROTECTED]: On 6/28/06

Re: [Catalyst] Program the logic

2006-06-28 Thread Eduardo Oliveros
@lists.rawmode.org Sent: Wednesday, June 28, 2006 5:11:27 PM Subject: Re: [Catalyst] Program the logic That leads to a new question: Is possible to call actions in the Controller without using a web browser? Thanks, --edu PD: I'll use DBIx::Class, sounds promising. 2006/6/28, Nilson Santos

Re: [Catalyst] Program the logic

2006-06-28 Thread Nilson Santos Figueiredo Junior
On 6/28/06, Eduardo Oliveros [EMAIL PROTECTED] wrote: When you create a Catalyst application some tests are created also. I thought calling the Controller actions could be performed by the testing framework... (without using a browser)... I guess I was wrong :) Yes, it can be performed