Play 2 Framework code generation tool or Yii/Cakephp frameworks? - frameworks

I'm trying to get started with a couple of web applications. However, choosing a framework to work with can be overwhelming!
I've worked with Java in the past, and since I do C# .NET at work, I don't mind learning and extending my Java knowledge. Now, the only framework that seems to work without jsp and other applet things that I've never understood is Play 2 Framework. I downloaded this framework, put the executable file in my path, and it seems that it would work for me. However, I came across CakePHP and Yii frameworks (I'm sure there is more) and notice there is a code generation tool that gets the database and automatically generates the models for you + the CRUD and such. Geez that is a save of time.
I went and googled my question and got that this is also possible in Play Framework (bummer only found the module for 1.x framework.)
How to quickly generate models in play framework 1.2?
http://www.playframework.org/modules/db
So, my question is...
Is there a module that would easily let you do this work in Java Play 2.0 Framework as in the mentioned PHP frameworks?
If no, would it be worthy (any advantages) to stick to the Java Framework?
If no, what php framework or even python (but Ruby) framework you consider has the best tools like this auto completion feature? I don't mean learning a new language, I will have to anyways. But rather to learn a language I can do things other than web development (for Ruby I know you can do more stuff but it might be just a waste of time to learn that other language. However, learning Python, Java, would open up app and phone development as well)
Don't mean to open a debate, please be concise (not like me) in your answer. Thanks!

From personal experience, there's several difference in both frameworks, particularly the way models are handled in cake vs yii.
In cakephp you cannot use composite primary key, this is the main deal-breaker for me. Composite primary key is supported in Yii.
Cakephp enforces convention, while yii favors convention, you are not forced to follow a certain standard.
Out of the box performance, I think yii has the advantage, but as with performance tuning, with proper cache configuration, and as long as you are careful in using the ActiveRecord patterns, they are not that much apart
As a side note, I have lead web app implementation with both CakePHP and Yii, the feedback that I got from the team was that the less experienced team preferes CakePHP, while Yii is preferred by the more experienced team. Make of that what you will.
Well it can turn out to be a very long debate. Each has its own life. So far from Experience I have found Yii to be most promissing than everyone. For me it matters who gives more work in less time. Cake is a bit heavy but Yii is light weight framework. I am from .Net Background but it took mew few weeks to get going with Yii

Related

Breeze compatible JavaScript GUI frameworks

While I already posted a similar question (Breeze compatible SPA building) and likely started something good going between IdeaBlade and Telerik as a consequence, I believe that Breeze deserves a lot wider recognition because of its unique approach to access Entity Framework on the server side. So, it seems pretty obvious to me that even notoriously complete JS frameworks like Sencha or Wakanda need to ensure to work with Breeze.
The current issues between KendoUI and Breeze are very clearly described in the post by Remco Blok at http://www.kendoui.com/blogs/teamblog/posts/13-02-21/breeze_js_and_the_kendo_ui_datasource.aspx. Stated succinctly the integration with Breeze should be made at the level of entities - not JSON data, which is the way almost everyone handles the transactions between a JS client and SQL server.
Wakanda is a great example of a very rich development environment with elaborate GUI Builder, Debugger etc that unfortunately cannot be used with "legacy data" on the server side.
As far as I know, Breeze works just fine with Angular, but Angular needs AngularUI (http://angular-ui.github.io/) which in turn is not as complete as I would like it to be and has some JQuery dependencies that may cause collisions. Pretty soon, Breeze will work with KendoUI (AFAIK) - does anyone know about some other collection of JavaScript frameworks that all together would offer the level of ease that Visual Studio provides for Windows desktop applications creation? (after all, JavaScript applications are desktop application with the distribution problem solved in a very elegant fashion).
I've been having a lot of success using breeze with durandal, bootstrap and knockout. Each of these frameworks kind of stick to their own responsibiliities- breeze for data, durandal for app plumbing, bootstrap for ui scaffolding and knockout for data-binding. This has proven to be pretty flexible and simplistic.

How to Move Already Written and working project With No Frameworks to Kohana?

I'm curious if it is possible to move the written and fully working project to Kohana step-by-step. I mean if it is possible to replace page by page. So the project will move consequently from 100% of non-framework code to 100% of Kohana code, page by page.
The project uses php/js/css/html, MySQL and Apache.
The project is huge (with a guest and member areas).
Thank you.
I've never used Kohana, but I'm quite familiar in other PHP framework (Yii). My guess is that it is NOT possible. Or to put it in other way: everything is possible (except opening an umbrella in your ass! :), but taking time (and money) into account, it is not worth doing so.
Most professional frameworks are complete opposite to "pure PHP" code in extremely many areas. Code is separated most times (MVC = model-view-controller design pattern) and uses mostly framework classes or code. I would even risk to say that writing an application in some pro framework means using only 10-20% of pure PHP code and doing rest 80-90% purely on framework classes, extensions, controllers etc.
In other words: porting a "pure PHP" application into framework code would mean writing that application from scratch. I'm not sure, if you would be able to copy-paste more than 5-10% of your source code?

Zend Framework - Ruby on Rails has a screencast showing how to code a blog in 15 minutes. Does ZF have a similar screencast?

Ruby on Rails has a screencast presentation they use to promote their framework that shows how to code a basic weblog system in 15 minutes with RoR. Does the Zend PHP Framework have a similar screencast/presentation/whatever demonstrating something similar? It doesn't have to be a blog specifically, but I would definitely like to find a presentation that shows some rapid application development using ZF.
Where I'm coming from: I have been programming on and off for years now. I started out with QBASIC waaaaay back in the day making little programs (text adventure games, screensavers, simple little things). I then moved to C++ but never really did anything too impressive with it. Since then (probably 5 years or so now) I have started to use C# for my desktop development and PHP for my web development. I've made some pretty cool tools here and there, but am certainly not a professional programmer by any stretch of the term as it has always simply been a hobby of mine.
Right now I have two major web applications that I will start work on shortly. (Like tomorrow, or later tonight ideally.. :) ) Both will be database-driven apps that will require user registration, the ability to manipulate data that is specific to their account (their posts, listings, user account details, etc), amongst other things.
Currently I am evaluating different frameworks to help me develop these web apps more quickly. I've been looking at, and have heard good things about Ruby on Rails. Hulu and YellowPages.com using it is an obvious endorsement - Of course, I have heard about the scalability issues that it potentially has; but that shouldn't be an issue with what I am working on. I don't expect millions of users per day for either project.
I am also seriously looking at the Zend Framework for my needs because I already have some experience with PHP. Ideally I would like to find a ZF screencast that shows an app being written quickly so that I have a roughly equal comparison between the two options I am exploring and can see first-hand how things get done in both.
That said - I am not opposed to considering frameworks other than RoR or ZF. The only research I've done on the subject has been over the past couple of days so I am quite certain that there are other excellent options out there that I've not even looked at - or heard of. Of course, it'd be awesome if there is a rapid app dev presentation that I can watch for whatever else is suggested.
So - Suggestions? Links to good screencasts that show rapid application development in other frameworks? Are there other PHP frameworks that I should be considering? (Ones that are easy to deploy would be ideal, so I don't have to purchase a dedicated server that I have full control over. I'd like to keep my hosting costs down assuming that it's reasonable)
Thanks in advance!
-Sootah
You can checkout ZendCasts.com
However, when deciding between ZF and RoR, you should be aware that they are very different from each other. RoR is a full stack with integrated ORM built on AR and a rather rigid structure. It's powerful and there is lots of magic inside and I'd say it's RAD capabilities are above ZF due to rake being more powerful than Zend_Tool
ZF, on the other hand, is first and foremost a loosely coupled component library with a use-at-will architecture for maximum flexibility. You can use it's components together, but you don't have to. While it does feature convention over configuration, ZF doesn't take you by the hand too much. It expects you know how to walk. Also ZF has no full fledged ORM and no AR, but you can very much integrate Doctrine or Propel or whatever library you like to use.
You often hear folks new to ZF complain about it is hard to get into it, simply because they expect ZF to work like RoR or Symfony or Cake, e.g. a full stack framework
EDIT:
Cake aims to be a port of RoR to PHP. It is built around ActiveRecord. Like CI < v2, it is backwards compatible with PHP4, which means it doesn't fully utilize the OOP capabilities you get in PHP5. I'd say both are easier to get in than ZF though.
This is a common question on SO.
I posted some valuable links in my response to this post
If you Google for such tutorials, look for Zend Application or Zend Tool, not ZF.
The difference between the other frameworks and Zend Framework is that Zend Framework is rather a general purpose framework, not application framework (not only for MVC, HTTP). E.g. Google uses ZF to provide access to their services.
You may easily use Symfony or CodeIgnitier with Zend Framework together.
BTW, To be precise, tutorials you ask are not blogs, but just a simple CRUD controllers. You may use Wordpress to create blog in 15 minutes, (then customize it) but not a PHP Framework.

Web Development Frameworks: Zend Framework vs Ruby on Rails vs ASP.NET MVC [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I've used Zend Framework before but would like to know how you think it compares to other MVC frameworks? Which is better and why?
Zend Framework my background with this is ~3 mths
Good:
Templating thru Zend_Layouts & Zend_Views
Zend_Forms, Zend_Validation, Zend_Filter: assists in form inputs
Zend_Tool now allows for something like Ruby on Rails's CMD code genration except that its now still very limited in terms of functionality
Bad:
steep learning curve
can be confusing for me now still
Ruby on Rails viewed some screencasts only
Good
i like the cmd code generation for controller, actions, models and forms
it seems to be easily incorporated with AJAX
Bad
i get the impression that it will be hard to deploy
ASP.NET MVC also watched a few screencasts only
Good
i like LINQ
extensive support with VS 2010 will speed up development
Bad
expensive
Zend Framework:
Good:
Stable API, acceptable performance, doesn't get in the way when it's not needed, easy to integrate legacy databases
Bad:
Hard to get into, sometimes confusing syntax
And also the general php advantages apply, such as easy deployment, portability, large ecosystem
Rails
Good:
Easy to create a working app, easy deployment with phusion passenger, nice unit testing integration
Bad:
Performance not always great, API is always changing, hard to break out of the framework
General
Rails is helpful to create an application very quick. It definately takes longer with the Zend Framework. But only as long as no problems arise. I feel that it's way harder to detect the root of a problem in rails. All the magic happening everywhere in rails is very nice in many cases but it makes the behaviour of the whole application less predictable. So if you don't want to follow the extact path, the framework creators have thought out for you, you'll likely run into serious problems with rails. You probably have to write a third less code with rails, but that costs you a third of your control over your application.
But the biggest annoyance for me was that rails changes very much between versions. I've spent a lot of time porting applications to newer rails versions, with deprecations and api changes here and functionality externalized to plugins there. It seems that rails isn't that mature as it's said to be.
I personally love Ruby - it's a great language to code in. I also write C#.NET for my proper job and think the MVC framework is the best thing to happen to .NET since it launched. However, for maximum portability I still use PHP for my own web projects as it's really easy to find cheap hosting on Linux (and it works on IIS too).
I would add to the list CakePHP. It's really a "Rails on PHP", with strict convention over configuration and strict MVC. I personally prefer CakePHP to Zend. Oh, and deployment is really really easy.
I develop mostly in php and ruby and I think there are pros and cons of both.
I think most of us agree, Zend takes a little longer to spin up a new app. The lack of command line tools and scaffolding make the process a little less expedited. But I feel the performance is better, a lot better actually.
Ruby/Rails spins up super fast and thanks to scaffolding, you can get a working skeleton extremely quick. Performance could be better though and I think Zend dominates Rails in this category. The language is fun as hell but as others have mentioned, there is way to much magic. If you find magic methods annoying in php, your going to hate the concept of ruby, where various code blocks or gems reopen base classes and create magic that has you scratching your head and thinking, "where the hell did this come from?". Also, as others have mentioned, unless you never update your application, be prepared for migrations. Rails 3.2 all the way to the latest version, 5.0.2, I think, will have you refactoring code for a while.
If I'm developing an app that I plan to work with long term, I usually go with Zend. If I need to spin it up fast and performace/load isn't much of a major factor, I go with rails.
I don't know if I've added any more insight then the other posters but these are my personal preference.

Do you need a framework to write Ruby or Python code for the web?

Every time I see Ruby or Python discussed in the context of web development, it's always with a framework (Rails for Ruby, Django for Python). Are these frameworks necessary? If not, is there a reason why these languages are often used within a framework, while Perl and PHP are not?
I can only speak towards Ruby - but, no, you don't need a framework to run Ruby based pages on the web. You do need a ruby enabled server, such as Apache running eruby/erb. But, once you do, you can create .rhtml files just like RoR, where it processes the inline ruby code.
The short answer is no, they are not necessary. In ruby you have .erb templates that can be used in a similar way as you use PHP pages. You can write a site in ruby or Python using several technologies (Rails-like frameworks, Templates or even talking directly with the HTTP library and building the page CGI-style).
Web frameworks like Python's Django or Ruby's Rails (there are many) just raise the level of abstraction from the PHP's or ASP's, and automate several process (like login, database interaction, REST API's) which is always a good thing.
"Need" is a strong word. You can certainly write Python without one, but I wouldn't want to.
Python wasn't designed (like PHP was, for example) as a direct web scripting language, so common web-ish things like connecting to databases isn't native, and frameworks are handy.
EDIT: mod_python exists for Apache, so if you're merely looking to write some scripts, then Python doesn't need a framework. If you want to build an entire site, I'd recommend using one.
From a Pythonic point of view, you'd absolutely want to use one of the frameworks. Yes, it might be possible to write a web app without them, but it's not going to be pretty. Here's a few things you'll (probably) end up writing from scratch:
Templating: unless you're writing a really really quick hack, you don't want to be generating all of your HTML within your Python code -- this is a really poor design that becomes a maintainability nightmare.
URL Processing: splitting a URL and identifying which code to run isn't a trivial task. Django (for example) provides a fantastic mechanism to map from a set of regular expressions to a set of view functions.
Authentication: rolling your own login/logout/session management code is a pain, especially when there's already pre-written (and tested) code available
Error handling: frameworks already have a good mechanism in place to a) help you debug your app, and b) help redirect to proper 404 and 500 pages.
To add to this, all of the framework libraries are all heavily tested (and fire tested). Additionally, there are communities of people who are developing using the same code base, so if you have any questions, you can probably find help.
In summary, you don't have to, but unless your project is "a new web framework", you're probably better off using one of the existing ones instead.
Framework? Heck, you don't even need a web server if you're using Python, you can make one in around three lines of code.
As to the why:
The most plausible thing I can think of is that Perl and PHP were developed before the notion of using frameworks for web apps became popular. Hence, the "old" way of doing things has stuck around in those cultures. Ruby and Python became popular after frameworks became popular, hence they developed together. If your language has a good framework (or more than one) that's well supported by the community, there's not much reason to try to write a Web App without one.
A framework isn't necessary per se, but it can certainly speed development and help you write "better" code. In PHP, there are definitely frameworks that get used like CakePHP, and in Perl there are many as well like Mason and Catalyst.
The frameworks aren't necessary. However, a lot of developers think frameworks ease development by automating a lot of things. For example, Django will create a production-ready backend for you based on your database structure. It also has lets you incorporate various plugins if you choose. I don't know too much about Rails or Perl frameworks, but PHP frameworks such as Zend, Symfony, Code Igniter, CakePHP, etc are used widely.
Where I work at we rolled our own PHP framework.
Are these frameworks necessary?
No. They, like any 'framework', are simply for speeding up development time and making the programmer's job easier.
If not, is there a reason why these languages are often used within a framework, while Perl and PHP are not?
PHP and Perl were popular languages for building web sites well before the idea of using frameworks was. Frameworks like Rails are what gave Ruby it's following. I'm not sure that Python or Ruby were that common as web languages before they were backed by frameworks.
These days, even PHP/Perl web developement should be backed by a framework (of which there are now many).
By no means are those development frameworks required. But as with most development environments, your productivity will increase exponentially if you have a supported framework to reference and build your applications on. It also decreases the training needed to bring others up to speed on your applications if they already have a core understanding of the framework that you use.
For python, the answer is No you don't have to. You can write python directly behind your web server very easily, take a look at mod_python for how to do it.
A lot of people like frameworks because they supply a lot of the boilerplate code in a reliable form so you don't have to write it yourself. But, like any code project, you should choose the tools and frameworks on their merit for your problem.
You can certainly write CGI scripts in either language and do things "raw".
The frameworks (ideally) save the trouble of writing a pile of code for things that other people have already handled (session handling, etc.).
The decision probably comes down to what you need to do. If the framework has the features you need, why not use it. If the framework is going to require extensive modifications, it might be easier to roll your own stuff. Or check out a different framework.
The python library has numerous modules for doing cgi, parsing html, cookies, WSGI, etc:
http://docs.python.org/library/index.html
PHP has a lot of frameworks. Probably more then most. In Ruby most use Rails so thats what you hear, and Django for Python is mentioned more then not.
But with PHP you have many to choose from.
List of web application frameworks
Any language that can "print" can be used to generate web pages, but frameworks handle a lot of the HTML generation for you. They let you concentrate more on the content and less on the details of coding the raw HTML.