The Validation Application Block in Enterprise Library 4.1

06/16/2009

The Enterprise Library Validation Application Block provides useful features that allow developers to implement structured and easy-to-maintain validation scenarios in their applications. Any application that accepts input either from users or from other systems must ensure that the information is valid in terms of some set of rules that you specify. For example, when processing an order, you may need to check that a customer's phone number has the correct number of digits or that a date falls within a particular range. In addition, if the validation fails, you may need to send an error message that explains what is wrong.

The Enterprise Library Validation Application Block provides a library of classes named validators, which implement functionality for validating .NET Framework data types. For example, one validator checks for null strings and another validator checks that a number falls within a specified range.

There are also special validators named AndCompositeValidator and OrCompositeValidator. If you create an AndCompositeValidator, which aggregates other validators, all validators in the composite validator must return T rue for successful validation. If you create an OrCompositeValidator, at least one of the validators in the composite validator must return T rue for successful validation.

You can also group validators together in a rule set. A rule set allows you to validate a complex object or graph by composing different validators of different types and applying them to elements in the object graph. Examples of these elements include fields, properties, and nested objects.

By using the Validation Application Block, you can perform validation and create rule sets in the following three ways:

  • Using configuration
  • Using attributes
  • Using code

In addition, the Validation Application Block includes adapters that allow you to use the application block with the following technologies:

  • ASP.NET
  • Windows Forms
  • Windows Communications Framework (WCF)
Posted in: .NET Framework| Tags: Enterprise Library Block Application Validation Application Block Validation number example enterprise rule validator library range

Overview of LINQ in .NET 3.0

06/12/2009

When developers write enterprise applications using an object-based language (for example C#, Java, or Visual Basic), they typically switch from writing code in that language to writing string-based SQL or XQuery commands to access data. This requires developers to master multiple languages and understand the semantic differences. In this lab you will learn how to use LINQ to SQL to manage (and query) relational data as native language objects.

LINQ to SQL, a component of the LINQ Project, provides a run-time infrastructure for managing relational data as objects. It does this by translating language-integrated queries into SQL for execution by the database and then translating the tabular results back into objects you define. Your application is then free to manipulate the objects while LINQ to SQL stays in the background tracking your changes automatically.

Objectives

In this lab you will learn how to:

  • Use LINQ to SQL to implement a resource access layer that interacts with an existing Microsoft SQL Server database
  • Use the LINQ to SQL Designer to create LINQ to SQL entity classes and associations (relationships) based on tables in a database
  • Manage the DataContext and how to use where clauses, perform joins, order the results, and handle conflict detection
Posted in: .NET Framework| Tags: .NET LINQ Objectives LINQ to SQL Overview language example enterprise

System Requirements of Enterprise Library 4.1

06/12/2009

For all application blocks except for the Unity Application Block, the Enterprise Library core features, and the configuration tools, the minimum requirements are:

Microsoft Windows XP Professional, Windows Server 2003, Windows Server 2008, or Windows Vista operating system
Microsoft .NET Framework 3.5 or later
Microsoft Visual Studio 2008 development system (any of the following editions):
Standard Edition
Professional Edition
Team Edition for Software Developers
Team Edition for Software Testers
Team Edition for Software Architects
Team Suite

Note:
The Unity Application Block is a general-purpose dependency injection mechanism designed for use in applications that run on the .NET Framework 2.0 and later. It is not limited to use only within Enterprise Library. For details of the system requirements and development software requirements for the Unity Application Block, see System Requirements for the Unity Application Block.

To run the Unit Tests, the following is also required:

Visual Studio 2008 Professional or Visual Studio 2008 Team Edition. Enterprise Library includes both unit test binaries and source code. You need a version of Visual Studio that supports unit tests. For instructions about how to use the unit tests, see Unit Tests. If you modify the unit test source, you will need to recompile it, which also requires Visual Studio 2008 Professional or Visual Studio 2008 Team Edition.
For the Data Access Application Block, the following is also required:

A database server running a database that is supported by a .NET Framework 3.5 data provider. This includes SQL Server 2000 or later, SQL Server 2005 Compact Edition, and Oracle 9i or later. The database server can also run a database that is supported by the .NET Framework 3.5 data providers for OLE DB or ODBC.
For the Logging Application Block, the following is also required:

Stores to maintain log messages. If you are using the MsmqTraceListener trace listener to store log messages, you need a message queue. If you are using the DatabaseTraceListener trace listener to store log messages, you need a database server. If you are using the EmailTraceListener trace listener to store log messages, you need an SMTP server.

Posted in: .NET Framework| Tags: Enterprise Library Requirements .NET 3.5 Block team database enterprise server visual unit system edition studio

Hot Posts

Latest posts

Tags

Others

Sponsors