Kinetic Framework Documentation
Step 1: Generate The Framework
There are two major requirements before you can start using the Kinetic Framework. First, you need Codesmith 4.1 or later. It does not require the full version of CodeSmith Professional - you can generate with the $99 basic version. It also requires that your database be completed. We assume you start from a database model and work your way up, and that's exactly how this framework is intended to be used. Once your database is in place, you can start generating code.
When you get the templates, you'll find a Main.cst file in the root. That's the file you want to use for your initial generation. When you open it, you'll see a few properties that you need to set:
- SourceDatabase - this is the database you want to generate against. You'll probably have to create a new connection to the database, which basically involves building a connection string and giving it a name. We use certain features that require SQL Server 2005, however, it will work with SQL Server Express.
- ExcludedTables - here you can exclude tables from having classes generated for them. If you have ASP.NET membership tables, you'll want to exclude those.
- TablePrefixes - this is a comma delimited list of prefixes to strip off tables for class names. For example, if all of your tables start with tbl, then the entity generated from tblOrders will be Order.
- Namespace - This is the root namespace for the whole application. We typically use <CompanyName>.<ProductName>.
- DomainNamespace - This is the namespace to add to the root namespace for your Domain / Business objects. We default to Business, but we've also used Domain and Core in the past. The resulting namespace for your business objects will be <Namespace>.<DomainNamespace>.
- SQLType - We support both Stored Procedures and Dynamic SQL. You can choose either one. If you choose Stored Procedures, we'll generate a database project with all of the stored procedures used by the default framework implementation.
- OutputDirectory - The most important one! This is where you'll get your code when it's done.
Once you have that done, just click Generate, sit back, and relax. In a few seconds, your framework will be ready to go. A key concept to understand is that you can regenerate code as many times as you want. Read about Active Generation
in order to get the most productivity out of this framework.