RapTier

Auto-generate Your Data Access Code

Brian Noyes

October 30, 2009

4 Min Read
ITPro Today logo in a gray background | ITPro Today

asp:review

 

RapTier

Auto-generateYour Data Access Code

 

By BrianNoyes

 

Some ofthe most mundane, tedious, and error-prone coding you must do in every seriousapplication is to create the data access code that will provide run-time datafor your application and persist that data back to a data store when needed.ADO.NET alleviates some of the pain by providing a consistent, easy to use,object-oriented model for data access to relational data stores. But you stillend up having to code the same patterns over and over to manage your data.RapTier by SharpPower can make it so you never have to write data access codeagain.

 

RapTieris a code-generation product that has a host of features focused on automatingthe creation of data access code, database scripts, documentation, and evensimple data access user interfaces. To use the product, you simply create aproject in RapTier, point to a database, and select the desired options forcode generation (see Figure 1). The core functionality of RapTier is to generatea .NET data access layer in either C# or VB.NET that is based on the Table DataGateway enterprise design pattern described by Martin Fowler in his book Patternsof Enterprise Application Architecture (Addison-Wesley, 2002). RapTiergenerates a clean, consistent set of classes for each table, view, or storedprocedure you select and allows you to retrieve all rows or one specific row,and then push updates, inserts, and deletes back to the database when needed.

 


Figure 1: Generate all your data access codefor your application and your database in one simple step.

 

RapTier-generatedcode allows you to work with the data in the form of ADO.NET DataTables, or asstrongly typed collections of business objects. It splits the code into a baseclass for each data collection that contains the core generated code, and aderived class where you can add your own business logic or validation code. Itallows you to regenerate the code if your schema changes and it maintains oldand new versions so you don't have to worry about losing your custom code. Andyou can work with your entire database as a project, doing the code generationin one fell swoop, instead of one table at a time (as with some other dataaccess code generators).

 

The dataaccess layer code generation alone is worth the price, but there is a lot moreto the product. The next best feature for me is the ability to automaticallycreate stored procedures to wrap any table or view. This makes it easy toenforce a stored procedure-only data access strategy for your database withouthaving to code all the standard CRUD procedures yourself. You can alsoautomatically generate MSDN-like database documentation that you can navigatein a browser. It extracts all the schema information, making it easy to discoverinformation about the database, without requiring access to SQL EnterpriseManager or another tool.

 

Theproject generated for data access code also can include a Web and/or Windows UIproject that lets you perform form and grid-based navigation and management ofthe underlying data. The generated code is useful for learning how to codeagainst the generated data access layer, and can also be used to cut and pastethe forms in the designer to save some time laying out your own UIs. However,most real apps are going to need to perform their own layout and may notinclude all fields, so this really just provides a good starting point, not afinished product. But it still results in yet more time savings in developingyour data-driven applications.

 

Overall,I found RapTier to be a simple to use, but powerful tool. The documentation isfairly detailed, although not overwhelming because the tool itself is so easyto use. If you aren't extremely picky about the shape or naming of your codingartifacts, you can use the functionality out of the box to save immense amountsof time. If you want to customize things, the code generation process is alldriven by customizable and extensible templates, so you can easily changethings like naming conventions and commenting, and you can also change theentire code-generation process with a bit more effort. If you are tired ofwriting CRUD code and would like to spend your time focusing on applicationcode, I recommend you check out RapTier. (There's a free version available, whichlimits the number of tables and views you can work with in a project.)

 

Rating:

Web Site:http://www.sharppower.com

Price: US$299

 

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like