IntroductionThe patterns I am using are Singleton, Strategy and Finite State Machine. These patterns are used in attempts to increase extensibility of the library and reduce the number of if blocks needed throughout the library. DetailsSingletonIs used in places like the tag and sasl registries to keep a single location for tracking the different tags and sasl processors available to the library. They are implemented with attributes and can take and assembly instance to add all applicable classes automatically. StrategyIs used with the tags to keep all tag specific processing within the tag itself. The main library will have no knowledge of what each tag is for allowing new tags to be added easily. StateIs used to keep track of where in the connection process we are. Starting to connect, SSL negotiation, SASL authentication etc... Each state will know what to do so the main class doesn't have to make that decision.
|