The API is responsible for displaying different files type. There are many scenarios where you want your application to use a different class or component to display different types of files. You can use “if-else” statements; however the problem is when you want to use different type of component or classes to handle the different types of files. Using the factory design pattern solve that problem; The concrete product needs to implements the “IView” interface and the component that is responsible for displaying the file can be of any type. “UIFileViewer” class is responsible for creating the component and adding it to the UIComponent.
This API will be in a new Flex 3.0 book I am writing called “Developing Enterprise Architect Applications.” click here to read more and pre-order.
All source code contained on this page has been published under the MIT licence and is protected as stated therein.
To see an example and download the source code click here:
http://elromdesign.com/blog/Flex/API/FileViewer/























0 Responses to “Display different file types using FileViewer, factory pattern open source API”
Leave a Reply