views:

79

answers:

5

How do you decided to use a framework (such as the Zend Framework) when building a new web app?

What are the advantages of starting from scratch as opposed to using a framework? I am well aware of the advantages of a framework, as well as some disadvantages.

I have heard it said that really large projects generally don't use an off-the-shelf framework but have a custom in-house framework/structure of some kind. Is inaccurate or what would be the reason for this?

+1  A: 

You decide to use a framework(plug-in, module) when you knowyou are going to reinvent something that is already coded and tested by someone else. Probably in 99% of cases.

Notice my update - third paragraph.
Icode4food
A: 

When You don't have much time use a framework.

czerasz
+3  A: 

How do you decided to use a framework (such as the Zend Framework) when building a new web app?

You should evaluate what requirements your new web application has. Then, compare the featureset provided by a framework and see if it fits the requirements. Also consider things such as licensing and developer familiarity.

What are the advantages of starting from scratch as opposed to using a framework?

In my opinion, none. A general purpose framework such as ZF can be easily adapted to most projects. However, if your projects purpose is purely to learn new things, it may be useful to do it yourself just to learn how to do it.

I have heard it said that really large projects generally don't use an off-the-shelf framework but have a custom in-house framework/structure of some kind. Is inaccurate or what would be the reason for this?

Reasons for this is often politics or the age of such projects. Go back some years and there were no frameworks/libraries very suitable for developing a large scale application. Today I don't see any reason you should not use a library, as it will significantly reduce development time and produce more error-free code (assuming the developers are familiar with the framework)

Jani Hartikainen
A: 

Here's my take on it...

I use a framework when I either want to build a one-off system, or rapidly prototype a system. Notice the word prototype. Be prepared to throw it away after it's built. The one-off system note is where you want to build something to do a well defined task, and the risk for both changes and copies are small (And hence maintenance is not a huge concern).

I use a set of libraries when I want to build a system that will have many copies made, or will need to be modified extensively over the course of its lifetime. Basically, this enforces a proper architectural design step from the beginning. This way you can ensure that the application will be designed to suit your requirements and anticipated changes from the beginning, rather than treating it as an afterthought.

Notice I said "set of libraries". What I mean by that, is that I take a "framework" that I like, and use it only as a set of helper functions. I don't build the app in that "mentality". I actually build the app to the architecture that was laid out (which often differs significantly from the frameworks preferred approach). I use the libraries when I can, and write custom classes where I can't.

Why do I say this? Well, my view point on it is simple. What makes a modern PHP Framework a "RAD" framework (Rapid Application Development)? Basically, it lets you skip the high architecture (which rightfully takes a fair bit of time), and get right to coding (since the framework developers did an architecture round for you). The problem with this viewpoint (from my perspective) is that there's nothing to say that the architecture takes into account the things that you need it to. It's a generic approach to a generic problem. The second you have an actual problem, a specific approach (if intelligently designed) should be far better than any generic approach...

I do use pre-made frameworks, but I use them depending on the need of the problem. If the problem warrants a full blown architecture (most that I deal with do IMHO), then I am not using the full potential of the framework. But I am trading some of that potential for making the application behave exactly as I need it to. It's a tradeoff, and you must realize that. But I feel that what I gain is far outweighed by what I loose... You must make the choice for yourself.

Just my $0.02...

ircmaxell
+3  A: 

The advantages of using a solid reliable framework:

  1. Someone else has done a lot of work for you.
  2. Someone else has given you a solid conceptual model as the basis for your application.
  3. Improvements to the framework become improvements to your application.

The disadvantages of using a solid reliable framework:

  1. Your application is dependent on the work of others.
  2. You have to use the framework’s conceptual model as the basis for your application. If it is a bad fit your development is going to be just that much more difficult.
  3. In order to incorporate improvements to the framework into your application you have to repeat your testing.
  4. Breaking changes in the framework may break your application.
  5. It may be difficult to get the framework author to make or accept proposed changes that are critical to the success of your application.
  6. If you make changes to the framework that aren’t accepted, you have to keep patching each new release.
  7. The framework author may abandon the framework, leaving you to support it yourself.
J Edward Ellis
Also, most PHP frameworks tend to be rather heavyweight (as opposed to microframeworks) and monolithic (as opposed to modular). This means you'll probably have to adapt your coding style to the particular framework more than you would like to. As a Pythonista I often find that all I really want from PHP frameworks is the ORM -- Apache already handles the routing and PHP already doubles as a template language.
Alan