SyteLine code out of the database project (C# conversion)
Migration of business logic from the database into the mid-tier layer has started. The purpose for doing so includes many opportunities to adopt current technologies in the form of .NET C# and better, more efficient solution scaling. With the newer technology, SyteLine can more easily offer system administrators better diagnostic and logging visibility during business logic execution. Database execution of the same logic typically required elevated privileges and server access commonly restricted in shared or highly secure environments. Mid-tier presence of these tools is typically not limited by these restrictions.
The migration process involves converting T-SQL objects to multiple C# class files having various purposes all sharing the duty of executing the same business logic of the original T-SQL object. The present model creates an application class and an interface for each object at a minimum. Additionally, if there is any Create, Read, Update, or Delete (CRUD) logic within the converted T-SQL object, one or more CRUD classes and associated interfaces are created. If business logic for a T-SQL object has not yet been moved to the middle tier, but instead, the application class just executes the stored procedure or function in the database, SyteLine refers to this as a "bounce" type application class.
Regarding EXTGENs, it is important to understand that even though the process of converting T-SQL objects to C# involves creating multiple class files and interfaces, all logic of the original T-SQL is still honored including checking the existence of exit points known as EXTGENs. This is important for backward compatibility and provides an opportunity for personalizations to exist as T-SQL objects while the current SyteLine implementation is in C#. To maintain full backward compatibility, all objects referenced within EXTGENs must exist as database objects themselves.
To illustrate the breakdown of a converted stored procedure to C#, see the images shown. The diagram depicts how a stored procedure-based IDO method becomes a hand-coded assembly method during the conversion process. In the new model, the extension class and composition root class, and the interface are the means to execute the application class. The Composition Root class is part of the Composition Root pattern which is used to compose instances of the application class to execute, handling all of the dependency injection process. It is the application class that contains business logic and is the C# equivalent of the T-SQL stored procedure. In the new model, most extensibility tasks are likely to occur within the application class.