FreeRadiantBunny Directories
The code of the FreeRadiantBunny application is contained within files. These files are organized into directories.
Directories
It turns out that it is convenient to keep certain types of files in certain places. The decisions of where to place where depend partly on how the code looks for other pieces of code that reside in other files. For example a child class must know where to find the code of the parent from whom it is inheriting code.
The directories also help to create partitioning effects. For example, note that the /usr directory is completely separate from the other directories.
This is so that a user can easily replace the /usr directory (to enable another configuration).
Well, that is the general idea of the design of the directories. More could be said about this design as compared to other webapps so stay tuned. Meanwhile, here is a description of the current directory structure so that it may be used and studied.
The 4 directories of freeradiantbunny are:
/freeradiantbunny/usr /freeradiantbunny/frb /freeradiantbunny/frb/lib /freeradiantbunny/frb/lib/db
Within each of the directories goes a particular types of files. It is comforting to know that each type of file has it's location in the directory structure. So, what is a type of file? Here are descriptions of the four types:
More could be said about the directories that contain the php files of code, so let's pass the mic in that direction.
Types of Classes
Of the 4 directories 3 of them contain code files (written in PHP) and 1 of them contains a database schema (written in SQL). For now we set the database file of SQL aside and focus only on the php files of code.
Much more could be said to describe the types of php files. Because each php file corresponds with a class.
So, here are some more detailed definitions of the types of files. Because each type of file is also a type of class.
There are three types of classes, as follows:
Class Type 1: /freeradiantbunny/usr
These classes are called the "User Classes".
The classes in /freeradiantbunny/usr are where a developer interfaces with the program and applies the custom data of an individual installation.
This is the config file where a user can store preferences.
Currently there is only one file in this directory, a Config class.
Thus the /usr directory of classes is comprised of (as of now) a single class. Nevertheless, in this file a user may specify configuration details, such as the details for database connections strings.
How to Edit the Config File
Class Type 2: /freeradiantbunny/frb
These classes are called the "Agent Classes".
The classes directly in /freeradiantbunny/frb are where a user using a web browser interfaces the program to access their build.
One class at a time is accessed, although the class accessed may have to use other classes to perform it requested function. Each of these classes essentially maintains an array of agents.
These are agents. Each class represents a thing, or a concept in the problem domain.
Each agent class is associated with a database table with the same name. Instances of the class constitute one row in the table. These classes are user-facing classes.
This class type is a place for classes that describe the abstract problem domain. These classes mimic the environment. These classes include the idea that an enterprise (or an initiative of any kind) deserves good goals articulation.
These objects help to the task of describing goals and the design processes that follow.
If you want to study the individual agent classes, a good place to start is: the Motivation Model Subsystem.
For more about Class Type 2 please see: an annotated Agent Classes List.
Class Type 3: /freeradiantbunny/frb/lib
These classes are called the "Library Classes".
The classes directly in /freeradiantbunny/frb/lib are the classes that describe the design shared by all instantiated Class Type 2 classes.
In object-oriented programming speak, the classes of Class Type 2 inherit the classes of Class Type 3.
So, the classes placed in the Class Type 3 directory represent a library of code. This library includes frequently used functions (like accessing the database) and parent classes that can be inherited (to create virtual agents with varying powers of description).
Some of the classes in this directory are considered to be utility classes. A utility classes is generally used only when a special function is needed. These special functions (like comparing 2 timestamps) are useful to many different Class Type 2 classes.
This library of classes is comprised of classes that are either inherited by other classes or instantiated to be used for common utility functions.
In terms of php, the Class Category 2 code include the Class Type 2 files.
And, the Class Category 3 files even include other Class Category 3 files, so as to build more complex agents.
This set of classes constitute an API for the freeradiantbunny developer, allowing that developer to create their own agent classes.
These classes are not used directly by the user's web-browsing (or other HTTP agent).
For more about Class Type 3 please see: an annotated Library Classes List.