Sunday, November 16, 2014

Re: Is CakePHP dead? (Or is it just this group?)

Okay, I've had another look at the docs, and after a search found 4 one-line references to loadModel in 680 pages of the manual ;-(

What concerns me is that as a user of the framework, I have to do a lot more work to get the same results, an example of which is on the very first page of Models

Instead of doing this

$this->request->data = $this->Articles->find('all);
You now recommend that I do this?

use Cake\ORM\TableRegistry;  $articles = TableRegistry::get('Articles');  $query = $articles->find();  foreach ($query as $row) {      echo $row->title;  }
That doesn't make sense to me, and doesn't look like progress??

Another example is from your blog tutorial, having to create instances of newEntity before I can save a new record, or patchEntity before I can save records etc etc. Yes, I understand that you need to get an new instance of a new object before you can use it, but all this was hidden from the user before, why does the user now have to do this?

The old Model class has been split into many parts. I tried writing a simple Users Controller in 3.xx and found that I needed to load just about every Class in the new ORM to support the various methods in the Controller, so again where is the advantage in that, making the ORM more granular, but having to load every Class anyway??

The User manual now reads more like a technical manual rather than a user manual and has I feel been pitched at a very different level of user. It is full of jargon and 'techie speak', which the previous manuals avoided. You will put off those wishing to try out the framework, with limited skills, or trying the learn the PHP language.

Why for example have all the references to installing Cake by downloading the latest zip file from Git has been removed? Yes again I know that Composer is the *preferred* method of installation, and has many advantages of over dropping a zip file in a users local web server, but again many new users do not like using command line tools, so what's wrong with recommending Composer, but still providing instructions for other methods. The removal of this section will put off new users.

I think that part of the problem here is that the core development team are so close to the new version that they do not see, or understand the issues this new version will bring to new and novice programmers. They've also been very quick to address the criticisms of the framework from hardcore programmers, but to the detriment of ordinary users. In fact version 3 of this framework, is so different from versions 1.xx and 2.xx perhaps you should consider re-branding the new framework, because it certainly isn't CakePHP 3.


On Friday, 14 November 2014 13:59:57 UTC, José Lorenzo wrote:
Also wanted to add.... for users that are still in th e2.x way of thinking you can still use arrays for expressing queries:

$this->loadModel('Articles');

articles = $this->find('all', [
  'fields' => ['title', 'body'],
  'conditions' => ['id' => 1]
]);


On Friday, November 14, 2014 2:49:27 PM UTC+1, José Lorenzo wrote:
Dave, you probably did not read the documentation. That would be the on;y explanation to say that it is not possible to get a simple find first in 3.0: Here is an example, and please not that there is absolutely no need to create any class for this example except a single controller named Articles:


$this->load('Articles');
$article = $this->Articles->get(12); // Equivalent to 2.x $this->Article->find('first', array('conditions' => array('id' => 12)));

$this->Articles->belongsTo('Authors');
$articles = $this->Articles->find()->contain('Authors'); // Equivalent to 2.x $this->Article->find('all', array('contain' => 'Author'));

In general all finds can be a find 'first' or a find 'all':
$this->Articles->find()->contain('Authors')->first(); // Equivalent to 2.x $this->Article->find('first', array('contain' => 'Author'));

How can that be considered more difficult to use?

On Friday, November 14, 2014 12:04:58 PM UTC+1, Dave Edwards wrote:


On Monday, 10 November 2014 09:28:38 UTC, Lucky1968 wrote:
I posted a few questions lately but I don't get any answers at all here. Only 1 reply (and that wasn't even an answer to my problem) to 5 questions or so.

Therefor I'm asking myself if the group of CakePHP developers is bleeding to death and if that's so, why?
Or is there a more intensively used group somewhere?

Are we waiting too long for the new CakePHP 3 version?
And, like I'm reading at several places, is there a much better and more advanced alternative (Laravel) which is even more advanced than our upcoming CakePHP 3 will be?

I'm a CakePHP enthusiast for many years now but I'm not an 'expert' programmer and when I started With CakePHP back then (1.3.x) there was a large community and questions were answered very quickly but that seems to have stopped for a while right now.
And I can also see that in this group a while ago we got like 10 updates a day while now we only have around 3 updates a day.

I don't want to change to an alternative framework at all but as I have read some comments on the upcoming CakePHP 3 and the fact that I like my code to be as much 'Cake' as possible it will require a (for me) rather steep learning curve and reading 'The Book' from scratch to take advantage of all new techniques.
With this in mind I'm doubting if it wouldn't be more appropriate to start learning an alternative (more advanced?) framework right away?

Thanks in advance for your comments

Hi Lucky,

You sound very much like me, a very strong CakePHP enthusiast, but not an expert programmer. I too started with CakePHP 1.xx and have progressed to 2.xx. I have produced some pretty impressive sites and applications, and love the simplicity of the framework.

I recently dipped my toe in the water with 3.xx and have found that the new ORM will make me decide whether to stay with the Framework or look elsewhere, in fact I recently installed Laravel to have a look.

Whilst the new ORM is undoubtedly more powerful and flexible, it does come at a huge cost in usability. Gone are the days where you can simply use $this->loadModel('Model') anywhere in a controller and then create a simple find first or find all, adding conditions, fields and associated tables where necessary with 'contain'. Now it seems that the Model object is split into multiple parts, so you have to decide whether you want to deal with tables, rows etc. You have to load this object, get an instance of the class, sometimes you use find, sometimes get etc. Then you have to loop through results etc etc. all to get the same result.

My own personal opinion is that overall this is a backward step, as all this was previously was hidden from the user. Usually evolution of a product usually simplifies it, and for many users the complexity has increased ten fold with no obvious benefit other than perhaps reduced db calls and response times, which lets face it, unless you are creating a Facebook type of application, the server will handle adequately.

What I would really like to see is some sort of simplified Model object layer which will cater for 80% of applications that do not require this new method of working.

It will also not be long before the Manual refers to ORM instead of Model (enter version 3.xx RC1 stage left), so that's going to confuse new users even more looking for the M in  MVC and finding ORM prominently displayed in its place instead.

Let us know what direction you end up going in.

Dave

--
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+unsubscribe@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/d/optout.

No comments: