c# Allow users to add Additional logic to application (called Logic) without access to Source
Posted on 2014-03-16
I have developed a c# application which allows users to define their own transactions by grouping SQL database records under a common transaction name. Effectively the application which runs the transactions is "dumb" with all of the logic residing in the database transaction records. By breaking any transaction down to its smallest elements and applying a sequence number and branching logic, they can define the processing flow required to run any transaction. Some of the database transactions are Input rules whilst other are Output rules, Logic/Decision rules, Constant rules, Update rules etc...
To enhance functionality each database transaction is capable of running pre-defined Commands either before , during or after the transaction record is processed. An example of this might be a Logic transactions which reads shop orders from an order master table via an SQL statement. (select order_number from ShopOrder_Master)]. By having pre-defined Commands CLR_LIST1 & ADD_LIST1 specified, the array LIST1 can be cleared down and subsequently populated with the output of the SQL statement. Another Command DRPDWN_LIST1 could copy the list of shop orders to a drop down list in preparation for an Input statement.
I would like to be able to ship this software with an option for users to be able to develop their own Commands and utilize these within their own transactions. Obviously the software shipped would just be the executable without source. I'm thinking along the lines of defining a class called "UserCommands", with source, where the users could define commands which would be called from the main application. However this would be a separate executable and I assume that it would not has access to the object instances of the main application.
Any insights into how I might be able to integrate user defined commands (ie commands yet to be defined) into the main application would be most welcome.