Archive for the ‘.NET & Other Microsoft Tech’ Category

I worked on .NetTiers Framework with some talented professionals for more than two years. We successfully used .NetTiers to generate Enterprise Entity as a LOB resource to support ERP applications. The Database can be as large as over 200 tables, with very complicate Data Model and relationships.  

Here are some very helpful information about .NetTiers:

From the .NetTiers web site, it introduces itself as:

.netTiers is a set of open source code generation templates that simplify the tasks of creating customized Application Tiers for your Microsoft.Net applications in just a few minutes.CodeSmith. .netTiers generated architecture is custom to your domain, uses familiar patterns, and follows the guidance of Microsoft’s recommended patterns and practices. In fact, the .netTiers base architecture is built upon the Microsoft Enterprise Library Application Blocks. Oh right, .netTiers is FREE!

.netTiers utilizes the power of the best code generation tool available today – CodeSmith to generate C# codes to build up a full version of Enterprise level entity. It is one of the best open sourced enterprise level entity framework. However, in the real world, professionals did encounter some technical diffculties to bring it up running for real products. With no official tech supports, you have to be brave and ready for some really tough challenges. Here are some of my notes for some important .NetTiers features and technical challenges when using .NetTiers open source templates. 

1.  Creates a full set of administration web controls, which serve as a basic yet fully functional web administration console for database. We did not use this feature because it was not available since we started. But this is definately a very useful feature which provides an admin tool to maintain the database, with very little development efforts. 

2. Easy to upgrade/update from Database version upgrade. The entity classes have partial classes and concrete classes generated and each entity is derived from its base class. it isolates the entity properties with the real CRUD action (called service functions), which might have some Business logic coded by programmer based on the business application needs. When upgrading the database, only the entity property is regenerated, but business logic still stay as it was, which is really Beautiful.

3. It automatically creates ASP.NET web service for distributed programming. This feature only needs some work if trying insert/update methods to pass entity as a parameter via web service, however, the proxy is generated automatically accrossing Servers/Clients.

4. Configuration is tricky but very flexible. Remember, it follows Microsoft best practice. Since it is fully integrated with Enterprise Library Application Blocks architecture,  it  has it’s own plug-in, we configured the application directly from the entlib configuration console. With building a file path link from web.cofig file to the entlib.config file, and hosting the Entlib assemblies in the Bin folder, the whole application blocks are plugged into the ERP web apps. It is working in .Net environment, and, the sharepoint environment.

5. A very impressive feature is that the code is fully nDoc commented (it is used for Descriping extended properties of the data table and column) and follows the Microsoft naming convension. It can automatically generate a standard MS Guide Doc for the entire entity library with no coding!! Amazing!

6. It automatically generates a full set of nUnit tests. This is really nice, which saves tons of time for testing.

7. The whole design is based on  Microsoft Enterprise Library Application Blocks, which is very nice architectsed and follows the Microsoft best practice. However, we still added our own tracer tools to keep tracing codes at different entity layers. A downside is that the .NetTiers is trying to catch up each new .Net version and new Enterprise Library Application Blocks version, it is hard to keep maintain an up-to-date .NetTiers template version in the real production enviornment. Our solution is to make sure a major release is stable, then added some customized templates and fixed some code bugs to support a major version with in a .Net 2.0 framework.

8.  A challenge we encountered: .NetTiers implemented its own transaction architecture based on .Net Transaction, which is different from SQL Transaction, so it is hard to recode on the template level to control transaction for some uncommitted case. for example:  when an undergoing save action is not successful for a main entity when the associated actions failed. UI level is using .NET transaction while entity level is using .Nettiers transaction controls. The solution we had is to use the strong type advantage to handle the case, using business logic code to uncommitted/recover data within .NetTiers Transaction Controls.

9. Advanced Entity Validation Rule Engine, which can use any of the pre-created or delegation for any custom rules. And we used this engine to collect validation errors and display them on the UI side by transfering it to the exception/error/warning handlers.

10. Creates a full website project, already pre-configured and ready to begin coding against your data immediately. Because we are build our own web controls pool and highly customized data panels using our own meta data, we did not directly use this feature. But it saves hundreds of hours’ development time for a quick enterprise level web application solution by using this feature. 

11.  Advanced C# programming: because it is a template, you need to play with some advanced C# code generation techs/methods such as generic type, reflection coding, Dynamic Invocation with Interfaces, etc…

Finally, always remember: this is an open source tool, and the template are just C# codes. As an advanced .NET developer, in thoery, you can control everything.


Read Full Post »

— This post is from my colleague(Michael Collier)’s note: Post here to make an e-copy to keep good stuff.

If you have ever deployed a web application, you realize the process isn’t exactly a pain free operation.  There are often several steps and people involved (especially in enterprise scenarios) and as such many areas were things can go wrong.  In at attempt to make the process less error prone, we many people/organizations try to introduce a heavy process around the developer-to-server admin hand off.  Well, with Microsoft Visual Studio 2010, Microsoft is hoping to ease the pain somewhat.  There was a nice announcement recently on the Visual Studio Web Developer Team Blog which attempts to showcase some of the new Visual Studio 2010 deployment features.

In short, here is what Microsoft is planning for the new web deployment features in VS2010:

  • Web Packaging – Use of a new deployment tool, MSDeploy, to create a .ZIP file that can be used to package your web application (IIS settings, content, SQL Server database, etc.)
  • Web.Config Transformation – Ability via MSBuild to transform your development web.config into your production web.config.
  • Database Deployment – Ability to script database data/scheme and package it for deployment – including the ability to sequence SQL script execution.
  • 1-Click Publish – Publish your web application and dependencies to IIS with 1-click.
    There is no doubt that these features will not solve every problem for every scenario of web application deployment.  But, I think the feature set does look promising and has potential to help out in many situations.  It’ll be an area to keep an eye on as Visual Studio 2010 gets closer to release.

Read more about the upcoming Visual Studio 2010 web deployment features at http://blogs.msdn.com/webdevtools/archive/2009/02/04/web-deployment-with-vs-2010-and-iis.aspx.

By Michael Collier

Read Full Post »