Saturday, January 22, 2011

Including libraries and custom class files

This is pretty simple stuff. If you have been working in Java, this is exactly same as adding jars and classes to the classpath. Here, just you include them in the application configuration file, i.e. application.xml

Let's assume that you have created all your Active Record files inside App_Code directory inside your protected/ directory. Let's include that in our application.xml

If you open your application.xml, you will see the <paths> tag at the top of the file. This is the section where you will include all files in the App_Code/ folder. Here is how you will do that.

<paths>
   <using namespace="System.Data.*">
   <using namespace="System.Data.ActiveRecord.*">
   <using namespace="Application.App_Code.*">
</paths>

All System related includes in snippet above are related to PRADO framework. All application specific classes are included with Application namespace, for example, Application.App_Code.* in above example.

Happy PRADO...

1 comment: