Nested Magic xpa Components (Magic xpa 4.x)
How are nested components handled?
Using the Magic xpa component methodology described in this paper, it is not inconceivable that you will have a system of components within components, known as nested components, in your application. This section explains how to work with nested components.
You may have a component that is used in an application. Then you may use the application that contains the original component as another component within another application. Or, you may have a component that contains all of your frequently used models, data sources, and programs, and then you create a module using those revealed objects. Next you create a package that uses that module. In both of the cases above, you have created nested component systems. The figure below displays a more complex nested component system.
In this example, we have Component A, with frequently used models, Data Sources (tables) and programs, and Component B, with frequently used events and global handlers. These two components are used in the Bookkeeping Module C and the Stock Module D. These two modules are used as components of the Accounting Application E, which also uses components A and B. In this case the same component is used three times and, in theory, would therefore need to be loaded three times, but this is not what really happens. The Magic xpa engine is smart and knows when a component has been loaded into memory and does not need to be loaded again for each instance.
|
Magic xpa recognizes a component by its full name. If the component is loaded as c:\Magic xpa x.x\comp.ecf in one container or host and is loaded as \\myserver\Magic xpa x.x\comp.ecf in another container, Magic xpa will identify these as the names of two different components even though they may point to the same component. The same is true if two different databases are used.
|
Limitation:
|
You cannot reveal objects from a nested component. In other words, a host project cannot reveal objects from one of its components.
|
Recursion:
|
It is now possible to use components recursively.
Since version: 3.3
|
Recursive Magic xpa Component