C
Carlo Razzeto
I have a question regarding the implementation of a factory design pattern
and objects which are declared at internal scope. Here is my situation:
Currently I'm working on an order processing library which will power a
webservice. I do not want any programmer outside of my libary to be able to
inheret from or even see the objects responcible for processing the order
entry XML, instead I have provided a public sealed class library which
exposes a method which accepts order entry XML. What this method needs to
do, is find the most appropriate order processing class, instantiate it and
pass the order entry data to it. However, because all these classes are
internal, with internal constructors, Activator.CreateInstance() will not be
able to create the objects. So I was wondering if anyone out there had more
advanced knowledge of Reflection than I, and might be able to point me in
the right direction with handling this type of situation.
I'm also running up against a wall with this issue in a database abtraction
library I wrote which publicly exposes the specific database objects,
(should) have internal constructors so end programmers must use the provided
factory method to establish a database connection.
Carlo Razzeto
and objects which are declared at internal scope. Here is my situation:
Currently I'm working on an order processing library which will power a
webservice. I do not want any programmer outside of my libary to be able to
inheret from or even see the objects responcible for processing the order
entry XML, instead I have provided a public sealed class library which
exposes a method which accepts order entry XML. What this method needs to
do, is find the most appropriate order processing class, instantiate it and
pass the order entry data to it. However, because all these classes are
internal, with internal constructors, Activator.CreateInstance() will not be
able to create the objects. So I was wondering if anyone out there had more
advanced knowledge of Reflection than I, and might be able to point me in
the right direction with handling this type of situation.
I'm also running up against a wall with this issue in a database abtraction
library I wrote which publicly exposes the specific database objects,
(should) have internal constructors so end programmers must use the provided
factory method to establish a database connection.
Carlo Razzeto