Novick Software
SQL Server Consulting ē Design ē Programming ē Tuning

  andy novick is a sql server mvp



Visual Business Objects cover

 Expert One-on-One
 Visual Basic .Net Business Objects

 By: Rockford Lhotka

 Publisher: Apress (Originally Published by WROX)

Review by Andrew Novick

Summary: Developes the CSLA framework for implementing n-Tier business applications.

Rocky Lhotka has been figuring out the best ways to construct an n-tier business application using Microsoft Technologies since the days of VB5. This book describes his Component-based Scalable Logical Architecture (CSLA) framework for the construction of the business objects and other layers of an n-tier application in the .Net environment using Visual Basic.Net as the development language.

In earlier books, Lhotka created the original CSLA the COM/DNA environment using Visual Basic 5 and then Visual Basic 6.0 as the development language. Rather than just upgrade the original, the .Net CSLA is a rewrite using all the available .Net classes and facilities.

In any design, choices have to be made. The book is particularly clear about the rationale behind each of the tradeoffs made and points out how the alternatives might be constructed. And none of this is glossed over. Whatís great about this book is the detailed walk through of the rationale behind each of the design decisions.

The design choices are introduced in the first three chapters that discuss the construction of frameworks in general and the key .Net technologies that are used for the CSLA.Net framework. In particular, remoting, serialization, Enterprise Services (COM+), reflection, attributes, and ADO.Net are covered. He also explains patterns such as The Data Factory pattern that are used to build the framework. These chapters are very worthwhile even if you never use the CSLA framework.

Once the framework is designed, Chapters 4 and 5 build the framework in VB.Net and C#, where itís needed to overcome a limitation of VB.Net. This is the generic framework and all the code is available for reuse for any project thatís built on CSLA. The capability for deploying in varying numbers of physical tiers, even thought the number of logical tiers is fixed is a key aspect of the construction.

Now that the framework is ready, Chapters 6 and 7 walk you through the design and construction of a small project management application. Hereís where the real business objects are built.

Chapters 8 and 9 build User Interfaces (UI) that use the business objects just created in Chapter 7 in a Windows Forms and ASP.Net Web Forms application. The responsibilities of the UI author are pretty clearly laid out. Chapter 10 builds a Web Services to some of the business functionality. This demonstrates how easy it is to properly expose and reuse the business objects.

Chapter 11 does something that I wish all business object designers would do before they publish their work. It takes a look at how to use the business objects in reporting and batch operations where the object oriented approach doesnít do as well as a more data-centric use of ADO.Net. Fortunately, Lhotka isnít stuck on a high horse and he shows how using ADO.Net directly works best in these situations.

The framework is masterfully constructed but thereís always room for improvement. Frameworks are always incomplete. Theyíre intended to be built upon and this one is no different. As I think about the changes that I might make I can only come up with a few.

One of them is the use of OUTPUT parameters to return the columns of a table when retrieving a single row. If youíre interested in this you might want to take a look at a series of articles that I wrote on about constructing stored procedures for the Create, Read, Update, and Delete operations. Youíll find the first of these at:
Iíll add a link to Part II when itís published in November.

Overall I can give a strong recommendation to this book. Iím looking forward to implementing CLAS on my next project.

Related Links:

List of Code Generation Tools

Presentation that discusses Deklarit. One (not so object oriented) code generation tool.


Personal Blog

New Tips:

Use dsinit to set the SQL Server instance for Windows Azure dev storage


Nov 7, '12
Loser: DB

Full Schedule