First look at newBee - part 2 (instalation and basic code)

One of the basic ideas of newBee is that you should be able to put a newBee application into any directory or subdirectory (as deep down as you like) and it should run, without the need to set up any mappings and without the need to put any framework files directly under the webroot. Upload and run! Yeah baby!

So installation of newBee is to simply copy the newBee (newBee application skeleton) files, or a ready developed newBee application and put it in a directory on a CF enabeled webserver.

Ok, for some (probably most) application you will be required to set up a data source, but that is not specific for this framework.

When you have copied the newBee application skeleton into a directory you can open the application in your web browser. You should then see something like this:

Having opened the site above you've in fact opened up a newBee application. Let's look at some code:

model/HelloWorld.cfc

<cfcomponent name="HelloWorld">
<cffunction name="HelloWorld">
<cfreturn "HelloWorld, you have installed the newBee application framework.">
</cffunction>
</cfcomponent>

view/mainpage.cfm

<cfoutput>
#strHW#
</cfoutput>

Here we see the entire model and the entire view at work. We have a cfc which has a function called HelloWorld that returns a string, and a view page that outputs a variable. We also see that the cfc and cfm file have no knowledge about eachother what so ever. This makes the code very flexible and reusable.

Next time we'll have a look at the xml files. As said earlier newBee is the controller layer between the model and the view, and the xml files is where you "instruct" the controller. Don't worry, it's not hard at all. Remember "Simplicity is the key".

Comments
What is the relationship between the variable #strHW# and the function... how does this get set? No probs if the explanation is in your next post on NewBee :)
# Posted By dc | 2/9/07 4:42 AM
Explanation follows in the next post indeed :)

Thank you for your interest :)
# Posted By Trond Ulseth | 2/9/07 5:13 AM