Next Previous Up Top Contents Index

2 Quick Start Tutorial

2.3 Creating the projects

In this section we create projects for the client and server parts of our CORBA-based Hello World application.

To create these projects we use the New Project wizard. For CORBA projects, the wizard can create either a client project, a server project, or both at once. Since we are writing both the client and the server, we are going to ask the wizard to create both our projects at once.

1. Select File > New... from the Functional Developer main window, or click the New Project button () on the toolbar.
The New Project wizard appears.

We are going to choose "CORBA Client and/or Server" as the project type. In the wizard, a CORBA project is a project defined relative to an IDL file. The IDL file is a file containing a declaration of the CORBA interfaces that the server implements and the client accesses, written in OMG's Interface Definition Language.

2. Select "CORBA Client and/or Server" in the Project type section.
3. Click Next.
The wizard moves to a second page.

Figure 2.1 The CORBA project page in the New Project wizard.

The second page, shown in Figure 2.1, has several options for building CORBA projects. This is where we can specify whether to create a client project, a server project, or both. We can also choose an IDL file to base projects upon, or let the wizard create an empty one that we can edit after the projects themselves have been created.

If you choose a CORBA IDL file on which to base the project, by default the file is copied into the project folder that you choose on the next page (or is left there if it is already in that folder). You can explicitly choose to leave an existing IDL file where it is and the generated projects will refer to it.

For the sake of this example, however, we will let the wizard generate a blank IDL file for us, and then we will write the IDL by hand.

4. Uncheck the "Use existing IDL file" check box.
5. Check the "Client" box and the "Server" box.

Next to the "Client" and Ý"Server" check boxes are options for the kind of supporting code we want to generate. Like other IDL compilers, Functional Developer's can create CORBA client stub and server skeleton code from IDL declarations. This stub and skeleton code, which is generated in the form of separate libraries, takes care of the details of communication between CORBA clients and servers.

The IDL compiler (which we call Scepter) also generates a protocol library that represents the spirit of the IDL declarations in Dylan, using generic function declarations, class declarations, and so on.

The protocol library is the public interface to the service provided by the servers and used by the clients, and is used by the stub and skeleton code libraries. On the server side, the protocol defines what you must implement by extending the skeleton implementation in the normal way, by adding methods, subclassing, and so on. On the client side, you use the protocol to invoke operations on the CORBA objects you have implemented in the server.

We will see more about protocol, stub, and skeleton libraries in Chapter 4, "Writing and Compiling IDL".

6. Make sure the "Client using" setting is "protocol and stubs" and the "Server using" setting is "protocol, stubs, and skeletons".
The wizard will set up the client and server projects so that, when they are built, the IDL compiler will be invoked automatically to read the IDL and create stub, skeleton, and protocol projects.
7. Click Next.
The wizard moves to a third page. This page is the wizard's standard page for entering the project name and location.

On this page we enter the name used to create the client and server projects. Because the wizard is going to create two projects, it uses the name we enter as the stem of each project name, and adds a suffix to identify the project as a client (-client) or server (-server).

8. Type my-hello-world into the "Name" field.
From this name, the wizard generates projects called My-Hello-World-Client and My-Hello-World-Server.
9. Click Advanced...
The Advanced Project Settings dialog appears.
10. Change the "Windows Subsystem" setting to "Windows Console" and click OK.
This step is necessary because the application is going to run in console mode, that is, without windowing.
11. Click Next.
The wizard moves to a fourth page. This page is the wizard's standard page for specifying how you want to choose libraries for your project.
12. Select the "Minimal" option.

The choice of "Minimal" makes the Hello World projects use only two libraries: the Functional-Dylan library, which provides the Dylan language and basic extensions, and the Dylan-ORB library, which provides the Functional Developer ORB implementation.

13. Click Next.
The wizard moves to a fifth and final page. This page is the wizard's standard page for entering source file header keywords.
14. Make any header keyword changes you want.
15. Click Finish.

The client and server projects are now fully defined. After you click Finish, the wizard creates the appropriate project files on disk. Then two project windows appear: one for the client project, My-Hello-World-Client, and one for the server project, My-Hello-World-Server.


Developing Component Software with CORBA - 26 May 1999

Next Previous Up Top Contents Index