First look at newBee (root structure)

So I've decided to get newBee out in the open. I just thought I'd start of by giving a very short introduction of the very basic functionality.

newBee is ment to be a very easy to learn and use MVC (Model-View-Controller) framework, where newBee acts as the Controller between your Model and your View files. Simplicity was my guiding word in making this framework.

The purpose is that your Model and View files should not know about each other. The goal is structure, re-usability and maintenance of your code.

So here is the root structure of a newBee application:

- Model
- View
- Controller
- Config
- application.cfm
- index.cfm

So, as you'd guess, your model (cfc's) goes into the Model directory. Your view files goes into the View directory. The controller directory contains the newBee framework files (you should not go in here unless you want to modify the framework itself). The Config directory holds the XML files you use to "instruct" the framework.

The application.cfm and index.cfm files should also be left as they are.

This was the simplest root structure I could think of for a MVC framework. Remember "Simplicity is the key".

Later today I'll try and get time for posting some code.

Comments
The only problem I have with your structure is you would need to disallow access to the Model, View, Controller & Config folders through your webserver (or maybe in your application.cfm, but that would then only protect *.cfm files)

I understand your 'simplicity' statement and agree with it thoroughly, but I know of know other way to keep this sort of structure whilst keeping the Model (etc) files out of the web root.

I;ve been toying about with the following (fairly unsatisfactorily!):
<approot>
- model
- view
- controller
- config
- www

Any opinions? Or am I just complicating matters by the insistence to have my core files for an app outside the web root?

Cheers
# Posted By dc | 2/7/07 6:32 AM
Security should of course be an issue. One of the goals of newBee though, is that you should be able to take a newBee application and put it anywhere in the directory structure of a website and it should work without setting up any mappings, or putting anything in the web root.

The only files that can not be protected from being opened directly would be the xml files. I might change it so that config.xml will now be config.xml.cfm in order to be able to protect these as well.

Thank you for your feedback - I'll take a closer look at how protection of direct access to files is carried out.
# Posted By Trond Ulseth | 2/7/07 8:20 AM
Cheers Trond, would definitely be interested in hearing how you proceed with NewBee, all sounds very interesting.
# Posted By dc | 2/7/07 11:06 AM
There are many useful informations in this article. Thanks and greetings from Thuringia!
# Posted By sihirlikuyu.com | 3/29/08 4:50 AM