Contents

Lesson 2: Set up the projects

An EGL application is organized in one or more projects,
each of which is a physical folder in the workspace. A project contains
an EGL source folder that is provided for you, and that folder contains
one or more packages, which in turn contain EGL source
files. This hierarchy is basic to your work in EGL: a project, then
an EGL source folder, then a package with EGL source files.

The
EGL source files include EGL parts, which are type definitions
that you create. For example, a Service part contains logic, and a
Record part can be the basis of a variable that you declare in your
Service part.

Packages are important because they separate parts
into different contexts, or namespaces:

A part name might be duplicated in two different packages, and
any EGL source code can reference each part precisely. The main benefit
of namespaces is that different teams can develop different EGL parts
without causing name collisions.

Each part name in a given package is unique within that package:

A part in one package can easily reference another part in the
same package by specifying the part name. For example, here is a declaration
of a record that is based on the Record part MyRecordPart:
myRecord MyRecordPart{};

A part in one package can also reference a part in a second package
by giving the package name and part name, or by a shortcut that involves
importing the part.

One project can reference the parts in a second project,
but only if the EGL build path of the referencing project identifies
the referenced project. Again, this tutorial gives examples. However,
in all cases, avoid using the same package name in different projects,
as that usage can cause problems in name resolution.

Your next
task in this tutorial is to create the following projects:

PaymentService

Holds an EGL Service part and related definitions

PaymentClient

Holds the Rich UI handlers and related definitions

PaymentShared

Holds parts used both on the Web client (the browser) by the handlers and on the Web application server by the EGL services.

You can include all your code in a single project,
but the separation shown here lets you easily deploy the two kinds
of code in different ways.

Parts in one project can use parts
in a different project. EGL uses a build path to search
for unresolved references. Later in this lesson, you will add the service project
to the build path for the client project and the shared project to the build path for both the service and client projects.

Create the PaymentShared project

To create the shared parts project:

From the file menu,left clink on New and select the EGL > EGL Project wizard.

On the EGL Project window, enter project name PaymentShared, select template basic, and left click on Next.

On the EGL Settings window, accept the default values and left click on Finish.

EGL creates a project named PaymentShared.
Note the folders inside the directory:

EGLSource

Put your packages and source files here.

src

Put any custom Java source
files here. These files are not overwritten during the generation
process.

JRE System Library

EGL uses this folder for JAR files that support the Java Runtime Environment.

Once you add your first EGL program, the following additional directories will be added automatically

generatedJava

EGL places the Java files
it generates here.

EDT Java runtime

EGL uses this folder for JAR files that support the EDT Java Runtime Environment.

Create the PaymentService project

To create an EGL service project:

From the file menu,left clink on New and select the EGL > EGL Project wizard.

On the EGL Project window, enter project name PaymentService, select template basic, and left click on Next.