Helma logo
helma.org » Home > docs > guide > introductions > Prototypes

Prototypes

Helma's coding conventions revolve around the prototype based object inheritance of Javascript. While Helma does not force you to leverage these coding conventions, doing so will increase productivity and you will achieve better maintainability due to a clean and well organized code structure.

The HopObject prototype is the core prototype of every Helma application. By default, other prototypes that you create will inherit from the HopObject prototype. Every directory that you create inside your application's code repository becomes automatically a prototype by that name and will inherit the methods, actions, macros and skins that the HopObject prototype provides.

In the "welcome" application's code repository at ./apps/welcome/code/ for example, you will find directories for the HopObject, Root and Guide prototypes. Both the Root and Guide prototypes inherit automatically any code from the HopObject prototype. Additionally, the Root prototype also inherits from the Guide prototype, due to the "_extends" property that is configured in ./apps/welcome/code/Root/type.properties

_extends = Guide
"Root" is the prototype of the application's root object. The root object of the "welcome" application therefore uses the combined code from these three prototypes, with code in "Root" overriding code from "Guide", which in turn overrides code from "HopObject".

When Helma receives a request to http://localhost:8080/ it will look for a "main" action to handle the request. Since it will not find one in "Root", it will use the one defined at ./apps/welcome/code/Guide/main.hac. Requests pointing to a generic HopObject such as http://localhost:8080/first/ on the other hand will use the main action defined at ./apps/welcome/code/HopObject/main.hac.

More information on how Helma puts prototypes to work:
/docs/guide/introduction/
/docs/guide/framework/


Up: Introductions
Previous: HopObjects Next: Database mapping

... comment


Page last modified on 2005-12-20 10:39 by czv

 
fabianbartsch, Thursday, 21. June 2007, 16:05
Missing/wrong link at this site
Hey guys!

I'm just stepping into helma right now, and as i was reading this introductions i have recognized that theres a missing or wrong link at this site:
/docs/guide/introduction/ is pointing to http://helma.org/docs/guide/introduction/
but there i get a 404-site.
just want to let you know that.

thank you for your work and have a nice day!

Fabian

... link  

 
davidm, Sunday, 1. July 2007, 03:37
Root vs Global
Hi all, I'm pretty confused re Global vs Root
thanks
Dave

... link  


... comment