Developing with a Component (Magic xpa 4.x)
When a component is loaded using the Composite Resource Repository, all repository items that were revealed are available in the current project. Let us take the example of the MSMQ Open Queue program that we discussed earlier. How do you call that program? Because this program is now an integral part of the project, you can just call the program.
As shown in the figure below, the program is called like any other Magic xpa program, with two arguments and a return value. The only difference here is in the name. The name of the program is preceded by the name of the component.
The same methodology used for programs is valid for all revealed objects.
As mentioned earlier, various Setup properties can be revealed. In the case of Servers, Services, Databases, and Logical Names, an extra line is added to the Magic.ini file of the host project for each reference. These properties are generally used for configuring or localizing the application, and they should be amended to suit the current environment. Except for Logical Names, all the properties are loaded as they were revealed together with all their values. The developer must fine-tune the values. Since the translation values of the Logical Names are on the development machine, the Logical Names will probably not be the same as on the computer where the component is implemented. Magic xpa therefore creates an entry without the translation values, allowing the developer on the host computer to add the correct values.
All of these settings can be accessed from within the host project because the component is now part of the host project.
It is important to remember that if component environment properties that are different from the properties in the current project, such as Date Mode and Start of Century, were revealed, the revealed values will only be valid within a program in the component. These values are generally only relevant during runtime. If a component program is called, these different values will only be valid for this program. When a program in the host uses a table from the component, it will use the environment values of the host project.
|
Magic xpa accesses objects in the component by Public Name. This means that despite the fact that we call the program Open Queue, we are actually calling MSMQOpenQueue. If a developer wants to call a different program, the Public Name MSMQOpenQueue must be removed from the Open Queue program entry and moved to the new program. No change is necessary to the interface.
|
Important:
|
As stated above, Magic xpa accesses objects in the component by Public Name. If an object is removed from the interface, it may still be called using the Public Name. If you no longer want this object to be called, you must also remove the Public Name. For Web Services, you may also simply clear the External check box. By doing this, the program will no longer be exposed for Web Services.
|