Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-27 Thread Matt S Trout
On Fri, Apr 24, 2009 at 02:08:14PM +1000, kakim...@tpg.com.au wrote: I took off the 'Authentication::Store::DBIC' from my use Catalyst qw( in myApp.pm. This is such that Catalyst/Plugin/Authentication/Store/DBIx/Class.pm will not be required. After all, no such thing exists(checked

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread Simon Wilcox
On 23/4/09 03:59, kakim...@tpg.com.au wrote: From the Catalyst tutes, I seem to get the impression that pretty much a lot of the business logic is done in the controller. Yes, because it's a Catalyst tutorial not a tutorial for whatever model provider you choose to use. You *can* put your

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread Matthias Dietrich
Hi, this is an interesting topic. I'm also one of that guys that put business logic into the controllers, but I never released any project yet, so it's my test Catalyst period and I'm still learning :) (and I never used MVC before). I had that problem to use data of the db outside of

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread Moritz Onken
So it's the model I put the business logic in? That sounds ok, for now. But what about this: * Input from the web has to be validated. May be I use Data::FormValidator, may be FormFu. However, I may have to validate the params I get from the script (eg. data import from ERP systems),

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread kakimoto
Gah Thanks, moritz.. 2am here and my coffee's runnin' low. haha that's the case i figure. I will give it a go tomorrow. Cheers! Quoting Moritz Onken on...@houseofdesign.de: So it's the model I put the business logic in? That sounds ok, for now. But what about this: * Input

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread Matt S Trout
On Thu, Apr 23, 2009 at 08:12:23AM +1000, kakim...@tpg.com.au wrote: Execution of test - start kakim...@dev-machine:~/projects/myApp/t$ prove -v userSubscriptions.t userSubscriptions.t .. ok 1 - use myApp::Schema::UserSubscriptions; ok 2 - The

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread kakimoto
I took off the 'Authentication::Store::DBIC' from my use Catalyst qw( in myApp.pm. This is such that Catalyst/Plugin/Authentication/Store/DBIx/Class.pm will not be required. After all, no such thing exists(checked cpan). Strangely, when I run scripts/myApp_server.pl, I got this message:

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Devin Austin
Can you show us the exact error that came up? You should be able to literally copy and paste your existing schema into your application's lib/ directory and use it thusly. You'll have to change the package name unless you put it directly under lib/. On Tue, Apr 21, 2009 at 10:41 PM,

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Matt S Trout
On Wed, Apr 22, 2009 at 02:41:34PM +1000, kakim...@tpg.com.au wrote: hi guys, I just looked at my app and found that I need to reuse the Schema files found in my 'Schema' directory. Your DBIC classes aren't connected to the Catalyst app at all. That's intentional. Just use DBIx::Class the

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Simon Wilcox
On 22/4/09 14:52, Matt S Trout wrote: On Wed, Apr 22, 2009 at 02:41:34PM +1000, kakim...@tpg.com.au wrote: I just looked at my app and found that I need to reuse the Schema files found in my 'Schema' directory. Your DBIC classes aren't connected to the Catalyst app at all. Unless you've

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Alexander Hartmaier
I have a MyNamespace::Model::DBIC module containing all ResultSet, ResultSource and Table classes. This module is a requirement for my Cat apps and is used in the apps schema: package MyNamespace::Web::AppName::Schema::AppName; use base qw/DBIx::Class::Schema/; # load subclassed tables

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread oliver . g . charles
kakim...@tpg.com.au wrote: Good morning. I am interested in hearing more about this. IMO the best place for your business logic is the controller. A view is made out of the html (usually templated with a templating system such as template toolkit). I believe the main suggestion is not to

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Peter Edwards
2009/4/22 kakim...@tpg.com.au Good morning. I am interested in hearing more about this. IMO the best place for your business logic is the controller. A view is made out of the html (usually templated with a templating system such as template toolkit). For example, in an application that

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread kakimoto
Hello. Matt, Good morning. Here's the execution output of the regression test and source code of the regression test. Execution of test - start kakim...@dev-machine:~/projects/myApp/t$ prove -v userSubscriptions.t userSubscriptions.t .. ok 1

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Simon Wilcox
On 22/4/09 23:03, kakim...@tpg.com.au wrote: IMO the best place for your business logic is the controller. Then you're wrong, at least in the eyes of many people. http://en.wikipedia.org/wiki/Model-view-controller The Controller is just a layer that converts the input to something that can

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread kakimoto
Hello, Peter, I had a look at your ExtJs app via the url given in this email. Basically, the script just makes direct calls to the Model. Business logic is found in the script itself and not the Model . Unfortunately, I still can't see the importance of business logic being placed in the

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Kieren Diment
On 23/04/2009, at 12:42 PM, kakim...@tpg.com.au wrote: Hello, Peter, I had a look at your ExtJs app via the url given in this email. Basically, the script just makes direct calls to the Model. Business logic is found in the script itself and not the Model . Unfortunately, I still can't see

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread kakimoto
Hello, Simon, Your points have good weight for thoughts. In fact, coming from many backgrounds pre-Catalyst and pre-MVC (ie many a times, the templating system ie Mason would do the job of both controller and view incorporating the business logic), I have been able to write regression tests to

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread kakimoto
From the Catalyst tutes, I seem to get the impression that pretty much a lot of the business logic is done in the controller. I might be wrong but in http://search.cpan.org/~hkclark/Catalyst-Manual-5.7020/lib/Catalyst/Manual/Tutorial/BasicCRUD.pod#___top (Add a Method to Process Form Values and

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread John Napiorkowski
--- On Wed, 4/22/09, kakim...@tpg.com.au kakim...@tpg.com.au wrote: From: kakim...@tpg.com.au kakim...@tpg.com.au Subject: Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes? To: Simon Wilcox sim...@digitalcraftsmen.net Cc: The elegant MVC web framework catalyst

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Kieren Diment
On 23/04/2009, at 12:59 PM, kakim...@tpg.com.au wrote: From the Catalyst tutes, I seem to get the impression that pretty much a lot of the business logic is done in the controller. I might be wrong but in

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread kakimoto
Hello Kieren, thank you for the link, http://blog.hide-k.net/archives/2008/10/dbixclassresult_1.php. Please correct me if I am wrong. Say if I have a Schema file, Schema/Subscriptions.pm After the section, DO NOT MODIFY ANYTHING ABOVE THIS! , I start declaring functions (not methods).

Re: [Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Kieren Diment
On 23/04/2009, at 1:48 PM, kakim...@tpg.com.au wrote: Hello Kieren, thank you for the link, http://blog.hide-k.net/archives/2008/10/dbixclassresult_1.php. Please correct me if I am wrong. Say if I have a Schema file, Schema/Subscriptions.pm After the section, DO NOT MODIFY ANYTHING

[Catalyst] how to reuse Catalyst Schema for non-web purposes?

2009-04-21 Thread kakimoto
hi guys, I just looked at my app and found that I need to reuse the Schema files found in my 'Schema' directory. This is because i need to write some batch scripts which will read the data in the databases and output to files in the server. I tried writing a regression test and put in 'use