Defining the C# Exposure

The following instructions describe how you can create a C# exposure for classes in the banking system. For more details, see "Chapter 17 - Using the C# Exposure Wizard", in the JADE Development Environment User's Guide.

  1. From the Browse menu in the BankingViewSchema, select Exposures and then select the C# tab. Right‑click and add an exposure.

  2. On the Define Exposure step of the wizard, name the exposure BankingClasses and then select schemas up to the BankingModelSchema.

  3. On the next step of the wizard, select the following classes.

    • Bank, to enable the application to access the root object's allCustomers collection

    • BankingModelSchema, to enable the root object to be accessed using the myBank reference

    • Customer, because the application will create customers

    You do not need direct access to this class from your C# application code. For simplicity in this tutorial, the BankAccount classes are not included.

  4. On the Select Features step of the wizard, for the Bank class, select the allCustomers collection.

    When you select the allCustomers collection, the CustomerByLastName collection class becomes part of the exposure. You never need to select the class of reference explicitly when using the C# Exposure wizard.

  5. For the BankingModelSchema, which is an Application subclass, select the myBank reference to the root object.

  6. For the Customer class, select the setPropertiesOnCreate method along with the address, firstNames, lastName, and number properties so that it can be invoked from your C# code.

  7. The Feature Mappings step of the wizard enables you to specify different names for the exposed classes, properties, and methods. Accept the default names without change.

    By default:

    • C# class names are the same as those of the corresponding JADE classes

    • C# property and method names are derived from the corresponding JADE names with the first letter changed to uppercase

  8. The Save step of the wizard summarizes the exposure definition to be saved.

  9. On the Generate step of the wizard, enter C:\Projects\BankingClasses as the directory where the C# project file and class files will be created.

    Check the option to create a sample C# project file. In addition, check the option to create an application configuration file using the following information specified on the form.

    • JADE database path

    • JADE initialization file location

    • Sign-on schema name

    • Sign-on application name, for which you should select DotNetConnection

    • Mode (multiuser or single user) in which the JADE database should be open when the C# application attempts to connect

    Note that this application configuration information is similar to that provided in the shortcut for a standard JADE client.

  10. Click the Generate file to generate the files when you build a C# project in the next section.