Flex Library Linkage – Difference between RSL and External
After a few days of research on the subject of linkage, I decided to write a post at my blog on Flex Architecture, And share it with you:
So today I wanna talk about the different types of linkage options you have when linking an external library project or swc to your flex project / library. As you know or may not know, you have 3 different linkage types in flex:
- Merged Into Code
- RSL (Runtime Shared Library)
So, what is the difference?
I thought I would write a simple straight forward explanation:
A library in it’s deployment is a SWC.
A SWC combines of a Library.swf with a xml of all the class definitions of the library, called: “Catalog.xml“
When you link a library to a project or another library, you sometimes load the actual Library.swf depending on the linkage type, but you always load it’s catalog.xml file into the main application’s ApplicationDomain.
“ApplicationDomain” is the storage of all the class definitions of an application, and all of the classes it is allow to refer in build and in runtime.
So, here is a summery of the difference between the linkage types:
Merged into code: loads the library’s catalog.xml to the ApplicationDomain and compiles it’s library.swf into the main application swf.
RSL: loads the library’s catalog.xml to the ApplicationDomain and loads only at the start of the runtime the swf into memory, so you could reach a class definition at runtime, and create an instance.
External: loads the library’s catalog.xml to the ApplicationDomain and doesn’t load the swf of the library at runtime, this option expects a preloading of the library swf into the ApplicationDomain.
A good example for this can be found at the end of my blog post: Flex Linkage - Difference between RSL and External
Feel free to ask questions or elaborate,