N S

Novick Software Management • Design • Programming • Training • Consulting

   

 

 

Visual Basic.net 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 www.DatabaseJournal.com about constructing stored procedures for the Create, Read, Update, and Delete operations. You’ll find the first of these at: http://www.databasejournal.com/features/mssql/article.php/3082201
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.


RSS as HTML

Personal Blog

 
New Tips:

Loading SQL Profiler trace (.trc) files with fn_trace_gettrace

Upcoming
Presentations:

Big Data:
Working with Terabytes
in SQL Server

July 9 '08


Full Schedule