P
phancey
I am trying to implement design patterns but not yet accomplished at
them.
I have a DataFactory that provides my business layer with objects. I
have a static property (Factory) that returns the specific type of
DataFactory in use (SqlServer in my case - a singleton).
I would like the business layer to be able to ask for a new instance
of a Job like this DataFactory.Factory.GetJob<T> where T is a specific
type of Job (MonitorJob etc) but T will only be indicating the
abstract version of it - there will be an actual SqlMonitorJob that is
the specific version but I do not want my business layer to be
bothered with that.
so the Business layer would ask DataFactory.Factory.GetJob<MonitorJob>
but would actually get a SqlMonitorJob. How should I code this to
avoid switch statements etc?
thanks
Phil
them.
I have a DataFactory that provides my business layer with objects. I
have a static property (Factory) that returns the specific type of
DataFactory in use (SqlServer in my case - a singleton).
I would like the business layer to be able to ask for a new instance
of a Job like this DataFactory.Factory.GetJob<T> where T is a specific
type of Job (MonitorJob etc) but T will only be indicating the
abstract version of it - there will be an actual SqlMonitorJob that is
the specific version but I do not want my business layer to be
bothered with that.
so the Business layer would ask DataFactory.Factory.GetJob<MonitorJob>
but would actually get a SqlMonitorJob. How should I code this to
avoid switch statements etc?
thanks
Phil