I my application I want to be able to apply different License Key
managers according to the currently active license key type.
I would love to represent a License Key in its own object. The license
key type would be determined by the String representation of the license
key. (For now the last letter of the license key would determine the
type). I was trying to do some good data abstraction by having the super
class license key and then some classes that iniherits from this super
class to have the more specific class that implements the right license
key type. For example a Trial key would be simple but other kind of keys
would have some information contained withing the string to
enable/disable features in the software. Would it be the factory to
first find out wich type of key it is from the string than instanciate
the right subclass?
I never used the factory design pattern and I would like to know if this
is an appropriate situation to use it and how should I design my License
key classes and subclasses?
any input is welcome,
Thank you
Simon
Sounds to me more like a straight forward OOP design would suffice.
Abstract license key base class defines virtual methods for all fetaures, or
even just a couple of virtual methods such as EnableFeatures,
DisableFeatures, GetAvailableFeatures, etc. Create dervied classes that
override the appropriate functions, and pass that into a generic method that
will call the appropriate functions via polymorphism.
Mark
Thanks!
Simon