Developing Applications with the CSI Framework
description
Transcript of Developing Applications with the CSI Framework
![Page 1: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/1.jpg)
Developing Applications with the CSI Framework
A General Guide
![Page 2: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/2.jpg)
Framework Overview
• Developed over 10 years (since 1999)
• Represents over two man-years development effort
• Object-oriented application framework
• Targets Win32 applications
• Can be used with Delphi 2005-2007
• Can be used with Windows 2000 and above
• Specifically targeted at multi-threaded multi-tiered/distributed applications
![Page 3: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/3.jpg)
Framework Goals
• Fundamental goal of the framework is to provide all necessary software “plumbing” for application development
• Secondary goal of the framework is to do this in a way that enables scalable development across threads and processes
![Page 4: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/4.jpg)
Using the Framework
• Latest version can be downloaded from the ADUG web-site
• Follow the installation guide to install
• Simple Developer’s Guide can be downloaded from the ADUG web-site
![Page 5: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/5.jpg)
Application Components
• Six types of application “components”:– Application threads– UI threads– Communications clients– Communications servers– Database managers– Globals component
![Page 6: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/6.jpg)
Application Messaging
• All application components, except database managers, are “connected” via the passing of application “messages”
• An application message is actually an object that holds arbitrarily structured information
• Component messaging interface enables the asynchronous and synchronous processing of messages
• Component messaging interface enables the registration of other application components as “consumers” or “handlers” of messages
![Page 7: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/7.jpg)
Application Configuration
• Static application configuration file (.cnf) lists the application components, their initial configuration, and their messaging connections
• Dynamic application settings file (.ini) enables any performance settings for each application component to be updated dynamically
![Page 8: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/8.jpg)
Framework Layers
• Split into four layers– Core– Utilities– Application– Framework
![Page 9: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/9.jpg)
Core Layer
• Essential system, string, date/time, file, and application routines
• Application logging, exception handling, and startup/shutdown management
• Configuration variable management• Singleton object management• Base threading framework, including a base thread
class, thread-safe utility classes, and thread-synchronisation classes/routines
• Essential utility classes, including integer set, id/value pairs, and text streams
![Page 10: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/10.jpg)
Utilities Layer
• Additional compression, encryption, and network routines
• Base threaded-queue framework, including a base threaded-queue class and additional thread-safe utility classes
• Additional utility classes, including XML object, XML parser/assembler, stopwatch, class registry, virtual directory, and persistent queue
• Utility components, including timer and file iterator
![Page 11: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/11.jpg)
Application Layer
• Application globals class to manage the application as a whole• Application configuration manager class to manage standard
configuration settings• Base thread message class to encapsulate arbitrary structured
data• Extended threaded-queue framework, including thread message
object handling and a thread timers class• Object/interface reference manager to enable the mapping of
object/interface references to strings• Generic TCP client and server classes for inter-process
communication• Generic database manager class for database access
![Page 12: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/12.jpg)
Framework Layer
• High-level management of inter-process communication
• High-level management of database access
• Implementation of a configurable "application component" framework
• Implementation of a consistent thread messaging interface for all thread and communication "application components“
• Separation of dynamic performance settings from static application configuration
![Page 13: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/13.jpg)
Useful Constructs/Techniques
• Separation of VCL-specific (non-RTL) code into a separate unit
• Implementation of an accurate high-resolution timer
• Optimised utility class to manage id-value pairs of strings
• Separation of Windows system-specific code into a separate unit
• Generic utility classes for text stream manipulation using records and fields
![Page 14: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/14.jpg)
Useful Constructs/Techniques (cont’d)
• Class registry to enable the mapping of class names to classes
• Virtual directory class to handle a large number of files in a single directory
• XXTEA 128-bit encryption routines
• Zip compression routines
![Page 15: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/15.jpg)
Useful Constructs/Techniques (cont’d)
• RAM and CPU usage logging
• Single application instance management
• Restart application on shutdown management
• Reference manager to enable the mapping of object/interface references to strings
• Thread timers class to implement timers for threads
![Page 16: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/16.jpg)
Framework Benefits
• Reduction in amount of untested application-specific code
• Simplified thread-specific code
• Simplified database access code
• Simplified user interface access code
• Built-in diagnostic tools to aid issues resolution
• Consistent implementation of common functionality
![Page 17: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/17.jpg)
Future Directions
• Cross-platform support: Win32 (now), .NET using Visual Studio (not yet released), Linux (hopefully with Delphi 2011)
• Additional core functionality: server solicit/client response message pattern (not yet released), thread pooling (in development)
• Simple installation support (in development)
• File Sync system (in development)
![Page 18: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/18.jpg)
Summary
• The CSI Framework provides a relatively easy way to develop complex multi-threaded multi-tiered/distributed applications
![Page 19: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/19.jpg)
Links
• http://www.adug.org.au/downloads/CSIFramework.html
![Page 20: Developing Applications with the CSI Framework](https://reader035.fdocuments.us/reader035/viewer/2022062519/56815022550346895dbe091f/html5/thumbnails/20.jpg)
Questions
• Any questions?