javalin.org
Javalin Packages
This document details the use of Javalin packages. And with Javalin it's all about class packages, specificially packages of class objects. So what exactly are they anyways?
The first thing we need to do is differentiate between the various uses of the term "object". A Class Object ( note uppercase ) is a logical expression or representation of a thing. What kind of thing? Anything that can be represented in code form. It acts as a sort of black box that allows you to perform certain operations with it. See Classes for more information.
A binary object ( note lowercase ) is the compiled binary representation of the Class Object. This will normally be the file with the .obj or .o file extension that the assembler creates when assembling your source code. Note that this does not preclude Object compilation to binary object form in memory.
A package is the container, or the collection, of all those binary objects in a single unit. The container may be a file directory where all those objects reside or may be a shared object library ( .dll or .so ) that is loaded into memory for invocation by a program.
Javalin has the requirement that all Class Objects be defined and contained within a package. The jpackage keyword is used in your source file to define the Class Object declarations in an include file ( .inc ) as well as the actual implementation of the methods associated with that class. Here is the syntax:
jpackage org.javalin.examples
This directive indicates to the Javalin system the name of the package that the Object declarations contained within this file are for. The package name org.javalin.examples also serves the dual purpose of indicating where in the system file hierarchy this package will expect to be located. Note that the name is relative to the JASMPATH root directory and is in Javalin's Uniform Resource Name ( URN ) format. You will see the following hierarchy repeated throughout this document as it is vitally intrinsic to the system:
JASMPATH
|-----system
|-----org
| |----javalin
| |-----examples
| |-----jfc
|------com
|----vendor1
| |------packagename
|----vendor2
|------packagename
Programmers are free to choose their own directory structure for developing applications that will not make use of other vendor packages. However, the JASMPATH/system and JASMPATH/org/javalin directories must exist in order to successfully use JASM. It is highly recommended that you follow this structuring if you plan on distributing objects based on the JASM model.