Re: Some talk about complex Applications with CakePHP

2013-11-16 Thread Ighor Martins
Ok. that helped me a lot. Thank you.

On Wednesday, November 13, 2013 3:58:25 AM UTC, Dakota wrote:
>
> Take a look at https://github.com/infinitas/infinities for an example of 
> an complex cakephp application.
>
> Also take a look at custom paginator methods.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-13 Thread Ighor Martins


On Wednesday, November 13, 2013 3:58:25 AM UTC, Dakota wrote:
>
> Take a look at https://github.com/infinitas/infinities for an example of 
> an complex cakephp application.
>
> Also take a look at custom paginator methods.
>

Ok. thank you. I'll definily take a look there :) 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-12 Thread Dakota
Take a look at https://github.com/infinitas/infinities for an example of an 
complex cakephp application.

Also take a look at custom paginator methods.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-12 Thread Ighor Martins
Thank you for your answer.
I know the problem is on my code, that's why I came here to ask that.
I use cake for almost 2 years now, and everywhere I look on the internet, I 
see people writing bunch of codes on controllers. I never really seen an 
application really active record oriented with Cake (Maybe It's my mistake, 
I didn't tried to find them too, just never seen one).

What I gave you was just a really simple example, of course, it's not a 
real code, and not as big as it would be on a real context.
I know it should be on my model, however, as I said, if that code was on my 
model, I wouldn't be able for example to use the paginate with it. Then I 
would need to write a little bit of that wouldn't be structured the same 
way of the rest of the application (which for me is worse than growing the 
controllers)


Thank you again.. appreciate your time helping me

On Monday, November 11, 2013 8:35:23 AM UTC, Florian Krämer wrote:
>
> The issue is your code not the framework. ;) No matter what framework 
> you're going to use, if you put all your code into controllers this won't 
> work out very well in Zend or Symphony as well. Also Cake does not force 
> you to do anything in a completely strict way, everything can be changed 
> but you won't make your live more easy by not following the conventions. 
> Cake definitely doesn't force you to put code into controllers, that's 
> plain wrong. 
>
> I guess you don't do unit testing, which is not good. Unit testing is a 
> must have, specially for big projects. I guess that because of your heavy 
> controllers, in fact controllers should by tiny and models fat. Models have 
> plenty of advantages, they can be shared between different controllers and 
> shell scripts while a controller method can't be shared that way. Also 
> testing models is easier than testing controllers. As rchavik already 
> pointed out lookup costume find methods in the book. If properly build it 
> should be also possible for you to create submodules, plugins for parts of 
> your applications that can be shared. Check the 
> https://github.com/cakedc/comments comments plugin for example. It 
> encapsulates all the comment code in a plugin and can be implemented within 
> ~1-2 hours in any application.
>
> Your code piece here that you put in the controller should be in fact a 
> model method. You can always pass args from the request object to a model 
> method. Even if the method can't be shared with another application for 
> some reason, it should go into the model.
>
> If you want objects returned in 2.0 there is a plugin for that as well, 
> just google it.
>
> If you want you can do a training session with us 
> http://www.cakedc.com/training, besides basic Cake lessons we can also 
> have a class about design patterns and best practice as well.
>
> On Sunday, November 10, 2013 3:51:26 PM UTC+1, Ighor Martins wrote:
>>
>>
>> This will be an application, with a custom software design. And CakePHP 
>> almost force us to follow it's strict design. At the same time, this 
>> platform won't require that enough for me to move to something like Zend. 
>>
>> So, I have knowledge about Cake, but I don't really know the best 
>> practices to develop big applications with Cake. Only normal websites.
>> Sometimes I even feel like cake almost force us grow our controllers code 
>> instead of models, and that's what's making me sad.
>> To give you an example:
>> I normally do things like this on controllers:
>> $this->MyModel->find('all', array(
>>   'contain' => array(
>>  'SecondLevelThing' => array(
>>'ThirdLevelThing' => array(
>>   'conditions' => 'thirdLevelThingConditions'
>>),
>>'conditions' => 'secondLevelThingConditions' 
>>  )
>>   )
>> ));
>>
>> I know CakePHP 3 will be there in a while to solve some of these issues, 
>> and it will finally return objects instead of arrays :)
>> but for now, how is the best design pattern to follow with CakePHP when 
>> developing big applications without fighting against the framewok?
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-11 Thread Florian Krämer
The issue is your code not the framework. ;) No matter what framework 
you're going to use, if you put all your code into controllers this won't 
work out very well in Zend or Symphony as well. Also Cake does not force 
you to do anything in a completely strict way, everything can be changed 
but you won't make your live more easy by not following the conventions. 
Cake definitely doesn't force you to put code into controllers, that's 
plain wrong. 

I guess you don't do unit testing, which is not good. Unit testing is a 
must have, specially for big projects. I guess that because of your heavy 
controllers, in fact controllers should by tiny and models fat. Models have 
plenty of advantages, they can be shared between different controllers and 
shell scripts while a controller method can't be shared that way. Also 
testing models is easier than testing controllers. As rchavik already 
pointed out lookup costume find methods in the book. If properly build it 
should be also possible for you to create submodules, plugins for parts of 
your applications that can be shared. Check the 
https://github.com/cakedc/comments comments plugin for example. It 
encapsulates all the comment code in a plugin and can be implemented within 
~1-2 hours in any application.

Your code piece here that you put in the controller should be in fact a 
model method. You can always pass args from the request object to a model 
method. Even if the method can't be shared with another application for 
some reason, it should go into the model.

If you want objects returned in 2.0 there is a plugin for that as well, 
just google it.

If you want you can do a training session with us 
http://www.cakedc.com/training, besides basic Cake lessons we can also have 
a class about design patterns and best practice as well.

On Sunday, November 10, 2013 3:51:26 PM UTC+1, Ighor Martins wrote:
>
>
> This will be an application, with a custom software design. And CakePHP 
> almost force us to follow it's strict design. At the same time, this 
> platform won't require that enough for me to move to something like Zend. 
>
> So, I have knowledge about Cake, but I don't really know the best 
> practices to develop big applications with Cake. Only normal websites.
> Sometimes I even feel like cake almost force us grow our controllers code 
> instead of models, and that's what's making me sad.
> To give you an example:
> I normally do things like this on controllers:
> $this->MyModel->find('all', array(
>   'contain' => array(
>  'SecondLevelThing' => array(
>'ThirdLevelThing' => array(
>   'conditions' => 'thirdLevelThingConditions'
>),
>'conditions' => 'secondLevelThingConditions' 
>  )
>   )
> ));
>
> I know CakePHP 3 will be there in a while to solve some of these issues, 
> and it will finally return objects instead of arrays :)
> but for now, how is the best design pattern to follow with CakePHP when 
> developing big applications without fighting against the framewok?
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-10 Thread Ivan Rimac
if this is going to be custom web app, based on your text i would really
recommend you using mongodb for this one, it should solve you most of your
concerns regarding speed. you have very good plugin of mongodb for cakephp.


On Mon, Nov 11, 2013 at 8:24 AM, Gaurav Matta wrote:

> Check this
>
> http://itfeast.blogspot.in/2013/10/cakephp-query-and-cache-optimization.html?m=1
> On 10-Nov-2013 8:21 PM, "Ighor Martins"  wrote:
>
>> Hi there!.
>>
>> I'm a web developer from Portugal for like 8 years. I have been using
>> CakePHP for about 1 year and a half right now, and I'm pretty used to it,
>> with a good knowledge of the Framework.
>>
>> On the last month, the company I work for, decided to create a new
>> company and engage on a new project.
>> The idea is to create a platform based on the needs of the company. It's
>> something like these sites: http://www.lynda.com/,
>> https://www.coursera.org/ and etc, but a little bit more complex, since
>> our final users isn't singular people, and some others functional
>> requirements that has to be done.
>>
>> So, Long story short, since last month we are developing a really small
>> "sneak peek" of the platform working (because we need something functional
>> ASAP), and then on the next month we're going to re-factor it all to
>> develop the final product. As you can imagine I'm using CakePHP on this
>> initial preview, and I'm wondering if I couldn't use CakePHP for the final
>> product too.
>>
>> We all know that a lot of people complain about CakePHP performance. But
>> we know too that 80% of these complains is due to bad use of the Framework.
>> Ok, Cake has a way of working that in some cases may have a really big
>> performance impact, for example it trying to format all the data into
>> relational arrays, which could be a problem in querys that return a really
>> big bunch of data, but ...
>> Sincerely performance isn't my biggest concern.
>> My biggest problem is:
>> This will be an application, with a custom software design. And CakePHP
>> almost force us to follow it's strict design. At the same time, this
>> platform won't require that enough for me to move to something like Zend.
>>
>> So, I have knowledge about Cake, but I don't really know the best
>> practices to develop big applications with Cake. Only normal websites.
>> Sometimes I even feel like cake almost force us grow our controllers code
>> instead of models, and that's what's making me sad.
>> To give you an example:
>> I normally do things like this on controllers:
>> $this->MyModel->find('all', array(
>>   'contain' => array(
>>  'SecondLevelThing' => array(
>>'ThirdLevelThing' => array(
>>   'conditions' => 'thirdLevelThingConditions'
>>),
>>'conditions' => 'secondLevelThingConditions'
>>  )
>>   )
>> ));
>>
>> Then I need this same information on other places of application. So I
>> just repeat the code, but as you can see, this is already a custom code, I
>> can't be re-writing this everywhere.
>> So I should do something like:
>> $this->MyModel->id = x
>> $this->MyModel->getCustomInfo();
>>
>> and this object method would return that information. But the problem is,
>> when I do that, I see myself fighting against Cake default way of working
>> in a lot of things, for example if I want to paginate that information, and
>> other things.
>>
>>
>> I know CakePHP 3 will be there in a while to solve some of these issues,
>> and it will finally return objects instead of arrays :)
>> but for now, how is the best design pattern to follow with CakePHP when
>> developing big applications without fighting against the framewok?
>>
>>
>> Thank you guys.
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to cake-php+unsubscr...@googlegroups.com.
>> To post to this group, send email to cake-php@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Ivan Rimac*
mail: i...@rimac.hr
*tel: +385 95 555 99 66*
*http://ivanrimac.com *
*http://rimac.hr *

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitte

Re: Some talk about complex Applications with CakePHP

2013-11-10 Thread Gaurav Matta
Check this
http://itfeast.blogspot.in/2013/10/cakephp-query-and-cache-optimization.html?m=1
On 10-Nov-2013 8:21 PM, "Ighor Martins"  wrote:

> Hi there!.
>
> I'm a web developer from Portugal for like 8 years. I have been using
> CakePHP for about 1 year and a half right now, and I'm pretty used to it,
> with a good knowledge of the Framework.
>
> On the last month, the company I work for, decided to create a new company
> and engage on a new project.
> The idea is to create a platform based on the needs of the company. It's
> something like these sites: http://www.lynda.com/,
> https://www.coursera.org/ and etc, but a little bit more complex, since
> our final users isn't singular people, and some others functional
> requirements that has to be done.
>
> So, Long story short, since last month we are developing a really small
> "sneak peek" of the platform working (because we need something functional
> ASAP), and then on the next month we're going to re-factor it all to
> develop the final product. As you can imagine I'm using CakePHP on this
> initial preview, and I'm wondering if I couldn't use CakePHP for the final
> product too.
>
> We all know that a lot of people complain about CakePHP performance. But
> we know too that 80% of these complains is due to bad use of the Framework.
> Ok, Cake has a way of working that in some cases may have a really big
> performance impact, for example it trying to format all the data into
> relational arrays, which could be a problem in querys that return a really
> big bunch of data, but ...
> Sincerely performance isn't my biggest concern.
> My biggest problem is:
> This will be an application, with a custom software design. And CakePHP
> almost force us to follow it's strict design. At the same time, this
> platform won't require that enough for me to move to something like Zend.
>
> So, I have knowledge about Cake, but I don't really know the best
> practices to develop big applications with Cake. Only normal websites.
> Sometimes I even feel like cake almost force us grow our controllers code
> instead of models, and that's what's making me sad.
> To give you an example:
> I normally do things like this on controllers:
> $this->MyModel->find('all', array(
>   'contain' => array(
>  'SecondLevelThing' => array(
>'ThirdLevelThing' => array(
>   'conditions' => 'thirdLevelThingConditions'
>),
>'conditions' => 'secondLevelThingConditions'
>  )
>   )
> ));
>
> Then I need this same information on other places of application. So I
> just repeat the code, but as you can see, this is already a custom code, I
> can't be re-writing this everywhere.
> So I should do something like:
> $this->MyModel->id = x
> $this->MyModel->getCustomInfo();
>
> and this object method would return that information. But the problem is,
> when I do that, I see myself fighting against Cake default way of working
> in a lot of things, for example if I want to paginate that information, and
> other things.
>
>
> I know CakePHP 3 will be there in a while to solve some of these issues,
> and it will finally return objects instead of arrays :)
> but for now, how is the best design pattern to follow with CakePHP when
> developing big applications without fighting against the framewok?
>
>
> Thank you guys.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Some talk about complex Applications with CakePHP

2013-11-10 Thread rchavik


On Sunday, November 10, 2013 9:51:26 PM UTC+7, Ighor Martins wrote:
>
> Hi there!.
>
> I'm a web developer from Portugal for like 8 years. I have been using 
> CakePHP for about 1 year and a half right now, and I'm pretty used to it, 
> with a good knowledge of the Framework.
>
> On the last month, the company I work for, decided to create a new company 
> and engage on a new project.
> The idea is to create a platform based on the needs of the company. It's 
> something like these sites: http://www.lynda.com/, 
> https://www.coursera.org/ and etc, but a little bit more complex, since 
> our final users isn't singular people, and some others functional 
> requirements that has to be done.
>
> So, Long story short, since last month we are developing a really small 
> "sneak peek" of the platform working (because we need something functional 
> ASAP), and then on the next month we're going to re-factor it all to 
> develop the final product. As you can imagine I'm using CakePHP on this 
> initial preview, and I'm wondering if I couldn't use CakePHP for the final 
> product too.
>
> We all know that a lot of people complain about CakePHP performance. But 
> we know too that 80% of these complains is due to bad use of the Framework.
> Ok, Cake has a way of working that in some cases may have a really big 
> performance impact, for example it trying to format all the data into 
> relational arrays, which could be a problem in querys that return a really 
> big bunch of data, but ...
> Sincerely performance isn't my biggest concern.
> My biggest problem is:
> This will be an application, with a custom software design. And CakePHP 
> almost force us to follow it's strict design. At the same time, this 
> platform won't require that enough for me to move to something like Zend. 
>
> So, I have knowledge about Cake, but I don't really know the best 
> practices to develop big applications with Cake. Only normal websites.
> Sometimes I even feel like cake almost force us grow our controllers code 
> instead of models, and that's what's making me sad.
> To give you an example:
> I normally do things like this on controllers:
> $this->MyModel->find('all', array(
>   'contain' => array(
>  'SecondLevelThing' => array(
>'ThirdLevelThing' => array(
>   'conditions' => 'thirdLevelThingConditions'
>),
>'conditions' => 'secondLevelThingConditions' 
>  )
>   )
> ));
>
> Then I need this same information on other places of application. So I 
> just repeat the code, but as you can see, this is already a custom code, I 
> can't be re-writing this everywhere.
> So I should do something like:
> $this->MyModel->id = x
> $this->MyModel->getCustomInfo() 
>

> and this object method would return that information. But the problem is, 
> when I do that, I see myself fighting against Cake default way of working 
> in a lot of things, for example if I want to paginate that information, and 
> other things.
>
>
You should lookup custom find methods in the book.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.