views:

661

answers:

7

Hello everyone,

I spend a lot of time (actually too much time) developping back-office applications whose main purpose is content management and web application configurations. Here is how I can describe these apps :

- Made with PHP
- Using a MySQL or Postgres or SQLite database
- Made of a lot of pages and features
- Very simple features, mostly data CRUD (create+read+update+delete into the database)
- Mostly made of forms
- UIs are usually quite simple (html + css + very basic javascript)

All of the data access code in these apps relies on a library I developped years ago and re-use every time I can. This part is not time-consuming.

What's time-consuming is the UI part, and mostly designing data-lists and forms. Using a WYSIWYG editor would make a lot of sense here, except those I tried (Dreamweaver, Frontpage, Expression, Eclipse, ...) don't really make it much faster, because the generated code is often bloated, and these tools can't rely on custom libraries such as the one I made and use.

I figured using a Web Tookit could be another way to spend less time developping these tools. So before I spend too much time looking for the perfect toolkit, I would appreciate your opinions and experiences on that kind of matter.

Disclaimer : I'm not looking for advices on how MVC is the way to go and how CodeIgniter/Zend/WhatEver is the framework I should use. My question is not about the frameworks or the design patterns I should build my applications upon. My question is about using the right tool to make simple web-applications development faster, and their code even more re-usable.

Is there an awesome web-application RAD tool I don't know about ?

Which toolkit do you use for simple but form-heavy web applications ?

Are there good, light, non-bloated, reliable toolkits written in PHP ?

Thanks in advance !


Edit : Not getting much feedback so far :/ I'm aware that my question is very broad, but I'm sure lots of people work on the same kind of projects I'm talking about, and have improved their productivity by using toolkits such as GWT, Wicket and such. Tell me about it, please :)


September 28 edit : Thanks everyone for the interesting answers. What I'm looking for is not covered by any framework I could try in the past months. PHP is probably not the best language to use for my vision of RAD, but since it's a language I know very well, and since I don't want to spend too much time learning Python as well as I know PHP (for the moment), I decided to do it by myself. Everytime I have a specific need for a widget, I code it in the most re-usable way...so far so good :)

I might open-source that toolkit at some point, and will let you guys know.

A: 

At the moment I'm using a solid forms class to render HTML forms with client- and server-side validation, and a database class to write the SQL. I can get a CRUD section of my admin console up in about 10 lines of code. I wrote those classes myself so I can re-use them in all my projects. Hopefully that gives you some ideas?

I would stay away from WYSIWYG tools personally.

Al
Out of curiosity, can you tell me more about the class you use to render your html forms ?About the WYSIWYG tools, I came to the same conclusion. My question is more about toolkits, which could be described as tools that help programmatically generate UI elements. I have the feeling they can be quite awesome for code re-usability, and I'm looking for testimonies about this.
Nicolas
The form class has an abstract class for form elements with subclasses for input boxes, textareas, selects etc. So I create a new form object, then add fields (with an ID, label, validation regex and a mouse-over hint), and finally request the HTML to render it. When the POST data comes back I create the form object as last time, load in the POST data and check validation. I can confirm re-usability is awesome :)
Al
That's pretty much the way I do it as well. I'm always very curious about the way people handle that kind of "classic" things, because it's something I deal with a lot, and every improvement in that field is always welcome :)
Nicolas
A: 

I'm testing NuBuilder.com, I discovered it does within days, at first looks promising. If you take a look please send me your feedbacks!

A: 

Maybe adopt or create an "app-based" infrastructure like Django's? In Django's case, the community has created some powerful baselines like Pinax.

orip
A: 

I think Symfony may be the way to go because, like your apps:

  • it's written in PHP
  • ORM based on Propel/doctrine (so you can use MySQL, Postgres or SQLite)
  • Architecture and patterns used will help you with complex applicatons
  • You'll find tools helping you to debug, document, and test your application
  • Forms creation, validation, l10n & i18n, testing, AJAX is easy (forms within symfony explained here, check it out)
  • prototyping you webpages while developing your application is easy

Other tools/practices implemented in the symfony framework that will make your life easy:

  • full configuration using YAML syntax (easy to read and understand)
  • the scaffolding feature generates for you a simple CRUD interface for editing your data.
  • you don't have to worry about coding form sanitization, security, caching, ACL; configuration is needed, but no heavy coding.

The only downside, you need to read some documentation to understand "the symfony way of doing things". But hey, a good framework is 20% code and 80% good practices.

My point is, even if you don't want to use Symfony for your project, you should check its features and built-in tools, because that's the kind of tools you want for your project.

Brian Clozel
+1  A: 

The PHP project I've been working on the past few years is a lot like that. Heavy on forms, heavy on server-side logic, but lots of redundant form coding. Too make matters worse, it wasn't all forms, sometimes we actually need to do fancy layout (even just doing a tree control is a pain without a library), and the home-grown nature of the UI meant that I would be battling browser quirks from start to finish.

So, I got to thinking about what a better architecture would be. We needed very powerful form controls, rich grids, rich trees, advanced layout, and we needed to migrate to that gradually. None of the PHP frameworks seemed to fit. Then I took a step back and realized that it didn't have to be PHP, it could be javascript also. We already had a requirement on javascript, so it was fine to go the distance with it. First I looked at the smaller libraries, jquery, prototype, but it became obvious that they didn't do enough. So I looked at Dojo, ExtJS, YUI, all the really heavy javascript toolkits, and settled on ExtJS as having the best controls.

We had a UI structure that relied heavily on iframes, a navigation frame on the outside, application frames inside that, feature frames inside that, and so on. What we ended up with is we're migrating those from the outside in. It's all becoming ExtJS, and it's all living in the same page. The server-side code is kept the same, but it's migrated into web services. At the same time we've integrated zend framework, and are porting some of the stuff you really shouldn't do home-grown to it, like authentication and translation.

The end goal is being able to write just the business logic without having to mess with all the boilerplate. It's too early to know if my approach will pan out, but I think my message would be to be critical towards your code base and decide which parts you want to keep writing yourself, and which parts you want to outsource to a library.

Joeri Sebrechts
A: 

I started using Django and it has very helpful features, esp. the built-in admin (for general CRUD stuff) and really great form-handling code & widget rendering. I'd suggest taking a look, even if you don't plan on using python, just to get an idea.

You mentioned that you don't want advice on "Use X framework", since this is more about RAD & UI/forms than system architecture. But I've found that a good framework helps just as much with the UI & forms side of things as it does the architecture. That means that while frameworks are great for big projects, they're also very helpful in reducing code redundancy. I started creating my own helper functions in PHP that I would copy from app to app that would automatically render an HTML form based on a few parameters. Even after a lot of work, this was very rudimentary compared to what Django offers, and basically I was writing my own framework.

I think you may be looking for a GUI-style tool to help, but you might find that a good PHP framework is more helpful in this case. At the very least, have you tried creating your own helper libraries? I know those helped me a lot.

Simple Example:

function renderInput($name, $value="") {
    print "<input type=\"input\" name=\"" . htmlentities($name) . "\" value=\"" . htmlentities($value) . "\" >";
}
function renderRadios($name, $value="", $choices=array()) {
    for ($choices as $cvalue) {
     print "<input type=\"checkbox\" name=\"" . htmlentities($name) . "\" value=\"" . htmlentities($cvalue) . "\" " . ($cvalue == $value ? "checked" : "") . ">";
    }
}

And build up from there. Stupid things like this tend to make form creation just that much faster. A good framework will blow this out of the water. And I'm sure the above has some typos, I haven't done PHP in a little bit.

If this isn't what you're looking for, could you add some more to the question? I'm curious.

Rocketmonkeys
A: 

Hi,

Although you're asking for PHP + MySql, I would like to recommend you to give a try to the OutSystems Agile Platform.

You can create a simple CRUD app in less that 10 minutes and grow it as you go to a more complex system.

Download the Community Edition for free at www.outsystems.com.

Best,

Mário André Araújo