R
Ravi Shankar
Hi all,
Please help, thanks for your valuable time.
We have a workflow engine implemented in certain language. There is an admin
console for the workflow. With the help of admin console we can predefine
the sequence and set of classes to be executed, whose names are stored in
the database. At run time, depending on what configuration is required, the
workflow engine retrieves the class names from database, intsntiates and
invokes the method using reflection.
I had taken the project, and immediately I told that dynamism in object
oriented systems is not implemented in this way, we have interfaces and
implementations. I proposed an interface called "Service" (with a method ,
say "invoke"), which will be implemented by all actual service classes, say
ServiceClass1, ServiceClass2 etc.WHen application begins, all ServiceClasses
will be added into a "MAP". Then from database I take the serviceclassname
and call invoke dynamically without reflection. Is this fine? Any better
implementation, any majo flaws and any suggestions, please advise, thanks
Best regards,
Ravi
Please help, thanks for your valuable time.
We have a workflow engine implemented in certain language. There is an admin
console for the workflow. With the help of admin console we can predefine
the sequence and set of classes to be executed, whose names are stored in
the database. At run time, depending on what configuration is required, the
workflow engine retrieves the class names from database, intsntiates and
invokes the method using reflection.
I had taken the project, and immediately I told that dynamism in object
oriented systems is not implemented in this way, we have interfaces and
implementations. I proposed an interface called "Service" (with a method ,
say "invoke"), which will be implemented by all actual service classes, say
ServiceClass1, ServiceClass2 etc.WHen application begins, all ServiceClasses
will be added into a "MAP". Then from database I take the serviceclassname
and call invoke dynamically without reflection. Is this fine? Any better
implementation, any majo flaws and any suggestions, please advise, thanks
Best regards,
Ravi