210 likes | 378 Vues
Developing Applications with the CSI Framework. A General Guide. 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
E N D
Developing Applications with the CSI Framework A General Guide
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
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
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
Application Components • Six types of application “components”: • Application threads • UI threads • Communications clients • Communications servers • Database managers • Globals component
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
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
Framework Layers • Split into four layers • Core • Utilities • Application • Framework
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
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
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
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
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
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
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
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
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)
Summary • The CSI Framework provides a relatively easy way to develop complex multi-threaded multi-tiered/distributed applications
Links • http://www.adug.org.au/downloads/CSIFramework.html
Questions • Any questions?