# MSS Code Factory: A Fractal Programming System

Prev | Documentation Home | Next

## Modelling a New Project

Run the CFBam Editor with no model name specified. This will let you create a new model.

`CFBamEditor29.bash`

In the hierarchy browser, create your internet hierarchy tree. One important fact is that you should specify both a MajorVersion and MinorVersion node for your project, regardless of whether it is a TopProject or a SubProject. SubProjects are optional, but as you can see, I make heavy use of that feature for MSS Code Factory itself.

After you've created the hierarchy, create a License for your project. It should normally be under the domain for your company, so that multiple projects can reference it in the future. After all, it is usually a company licensing the code.

You need to have some sort of domain for your project; there is no support for projects that aren't intended to be deployed on network servers. You can't go any deeper than TLD.TopDomain.SubDomain with the domains, though. That is usually sufficient to specify TLD.Company.Project, which is all I've ever really needed to do.

You can, of course, make your License specific to the project rather than shared throughout the company domain.

The Embedded Text of the License is what gets included in the header of every source file produced during manufacturing. It has to be valid for all kinds of files including XML and HTML files, so don't include HTML markup or un-escaped restricted characters in the text.

Now you are ready to create a SchemaDef. Select your MinorVersion node, and Add a SchemaDef. Configure the SchemaDef to reference the License you created, and fill out the details. I recommend that your DbSchemaName be in lowercase with no more than 7 characters for maximum portability. Note that MinorVersion and MajorVersion nodes cannot specify "0" as their name; "1" is the minimum name for a version. I have never tried using anything other than a number for a version, but you could try using someing like "Dev" for your MinorVersion and it should work. I just can't imagine any reason for wanting to use actual names for versions instead of numbers.

Note that MSS Code Factory expects all Names to be camelcase, so the shortest name you should use is two characters -- a leading uppercase character and a trailing lowercase character. The first character of a Name must always be uppercase.

Save your new Schema, and you should be taken to a form that lets you edit the components of a SchemaDef.

Select the Schema References tab, and Add a SchemaRef. In the resulting form is a choice box that is populated with the names of the models found on your model path as specified by your .msscfrc file from your HOME directory.

Select the "net-sourceforge-MSSCodeFactory-CFSecurity-2-10-CFSecurity" model and import the reference. You must always reference this model first.

If you wish to incorporate other models, go ahead and do so now. You can add forgotten Schema References later, but if you do so, you need to Add the new reference, save the model, and restart the editor to reload the model with the properly resolved schema references. If you try to edit the model after adding a new SchemaRef to an existing project, you will have all kinds of errors and problems crop up with the editor.

Close out all your windows to get back to the Hierarchy browser, select your SchemaDef node, and click Save. You'll be presented with a file chooser with a default name and directory. If you change the directory, you'll have to make sure it is one specified in your model path from $HOME/.msscfrc, or neither the factory nor the editor will be able to find your new model.

Exit the editor.

If you are going to be working with this model a lot, I recommend creating scripts for running the editor and the factory -- you can see examples of the run scripts in the bin directory of the factory; you can create a similar script for running the editor as well.

I'm going to assume you've created scripts named "ManufactureMyProject11" and "EditMyProject11", where both the major and minor versions of your new project are "1".

Manufacture your project to make sure everything is ok:

`ManufactureMyProject11`

You should hear no beeps and see messages about the created files rapidly scrolling by. When the run is done, you should have a new project directory tree created in your $HOME/msscodefactory directory, and can proceed with setting it up for a test build, building it, and maybe even doing a test installation.