Dot NET Enterprise Architecture
Dot NET Enterprise Architecture
Dot NET Enterprise Architecture
Developing .NET
Enterprise Applications
JOHN KANALAKIS
0465fm.qxd 7/19/03 3:21 PM Page ii
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.
Editorial Board: Dan Appleman, Craig Berry, Gary Cornell, Tony Davis, Steven Rycroft, Julian
Skinner, Martin Streicher, Jim Sumser, Karen Watterson, Gavin Wray, John Zukowski
Compositor: ContentWorks
Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 175 Fifth
Avenue, New York, NY, 10010 and outside the United States by Springer-Verlag GmbH & Co. KG,
Tiergartenstr. 17, 69112 Heidelberg, Germany.
For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219,
Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, email [email protected], or visit
http://www.apress.com.
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall
have any liability to any person or entity with respect to any loss or damage caused or alleged to
be caused directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com in the
Downloads section.
0465ch01.qxd 7/19/03 3:22 PM Page 1
CHAPTER 1
1
0465ch01.qxd 7/19/03 3:22 PM Page 2
Chapter 1
Marketing
Sales
Enterprise Human
Application Resources
Information
Technology Management
Customer
Support
Development
Business data is any data that helps a business operate more effectively. It typi-
cally needs to be accessed by different departments within an organization.
Business data needs to be reliably accessible, scalable, and secure.
Accessibility refers to the capability of multiple users operating on a variety
of platforms and devices being able to interact with the business data. Flexible
enterprise applications will have more than one form of user interface. In most
cases, one primary user interface client will be developed, and one or more
additional clients will be developed. This scenario might include a primary
Web-based client and supporting clients in the form of a Windows application,
a Pocket PC application, or a cellular phone application. All clients are accessi-
bility tools that help users interact with business data and services.
Scalability refers to the capability of increasing the number of system
resources, such as servers, to support an increase in the number of connected
users without impacting performance. Typically, smaller database applications,
2
0465ch01.qxd 7/19/03 3:22 PM Page 3
such as Microsoft Access or Microsoft Visual FoxPro, can reliably support large
amounts of data storage but with only a handful of concurrent connections. An
enterprise database, such as Microsoft SQL Server, Oracle, or MySQL, has built-
in support for handling larger volumes of data with hundreds of concurrent
connections, as well as transaction and backup services. However, such data-
bases are significantly more expensive and require specialized maintenance.
To secure business data, you offer data access to specific users privileged to
access that data. There are many different levels of security. For example, you
could fundamentally grant access to employees and block everyone who does
not work at the company. Then, within a company, you could grant access to
department team members and block everyone else. Finally, you could grant
access to certain levels of management and block everyone else. In this scenario,
you need to look at the data closely to determine which employee should access
which data. Also, you need to determine the type of data access: read-only, read-
write, or no access.
3
0465ch01.qxd 7/19/03 3:22 PM Page 4
Chapter 1
Business Distributed
Messaging
Facade Service
Enterprise
Data
4
0465ch01.qxd 7/19/03 3:22 PM Page 5
5
0465ch01.qxd 7/19/03 3:22 PM Page 6
Chapter 1
6
0465ch01.qxd 7/19/03 3:22 PM Page 7
In some respect, you can think of Microsoft’s .NET platform as the next genera-
tion of Windows DNA, an earlier platform for developing enterprise applications.
Windows DNA included many foundation technologies still found within the
.NET Framework, such as Microsoft Transaction Server (MTS), COM+, MSMQ,
and Microsoft SQL Server. The .NET Framework incorporates these technologies
and adds a Web service framework around them.
7
0465ch01.qxd 7/19/03 3:22 PM Page 8
Chapter 1
The .NET servers offer developers the flexibility to develop scalable enter-
prise applications. Enterprise applications can leverage the .NET servers to build
scalable applications quickly and reliably. The .NET servers include the following:
• Application Center Test Server: This server tests and measures the scala-
bility of enterprise applications by scripting and simulating concurrent
connections and measuring response times.
• Host Integration Server: This server offers integration with legacy applica-
tions, such as SAP, PeopleSoft, and Siebel Systems, with specialized data
adapters.
• Internet Security and Acceleration Server: This server offers firewall and
Web caching services.
• Microsoft Message Queue Server: This server manages and routes mes-
sages between applications within and between enterprises.
• SQL Server: This server manages enterprise data and accessibility to that
data with support for caching, indexing, transactions, stored procedures,
and backup/restore services.
8
0465ch01.qxd 7/19/03 3:22 PM Page 9
The success of any enterprise application depends upon how well its develop-
ment can follow a rigid process. This process typically maps into six specific
steps: capturing the requirements, prototyping, designing, developing, testing,
and releasing the application.
The most critical step in the development process is capturing the requirements.
Product managers need to listen closely to customer needs and expectations.
They need to document these requirements with clear descriptions of what data
is entered, what data is returned, and how the data is processed. In addition to
application requirements, product managers should discuss any type of printed
reports expected by the customer. Specifics include the type of report, format-
ting and graphic preferences, and performance expectations.
The design step should be the longest in the development process. You cannot
build an enterprise application ad-hoc with a general concept in mind. You need
to have detailed discussions about security, performance, and scalability. The first
step is to outline the high-level framework, as illustrated earlier in Figure 1-2.
Next, determine which elements you can purchase and which components you
need to build. Then, looking at the product requirements, you need to design the
database schema—one that can capture the necessary application data with flexi-
bility for expansion. Finally, you need to address a component-level design,
identifying which classes you will need to create, what their public and private
9
0465ch01.qxd 7/19/03 3:22 PM Page 10
Chapter 1
interfaces will be, what inheritance relationship they will have to each other, and
what data members will be private and public. When you have clearly defined the
application from a high-level picture down to a database schema and class defini-
tion, it is time for development.
10
0465ch01.qxd 7/19/03 3:22 PM Page 11
11
0465ch01.qxd 7/19/03 3:22 PM Page 12
Chapter 1
12
0465ch01.qxd 7/19/03 3:22 PM Page 13
Business Distributed
MSMQ
Facade Service
SQL
Server
The user interface details provide the next level of technical information.
This specifies exactly what user controls will be displayed within each Windows
form or Web page. This specification also includes additional details for each
control, such as what events each control responds to and what business func-
tionality is executed. Finally, the specification indicates data formatting and data
validation. Data formatting outlines how a label or textbox should represent
data, such as percentages vs. currency. Data validation outlines the acceptable
ranges for textbox controls, such as restricting letters from a number entry field.
The database schema is one of the most important elements of the enterprise
application design. The difference between a good schema and a bad one can
determine the scalability and performance of the application. It is important to
structure the schema for extensibility because new features will certainly work
13
0465ch01.qxd 7/19/03 3:22 PM Page 14
Chapter 1
their way into the product. However, abstracting data into too many tables will
result in poor performance because all the tables will then need to be joined.
Figure 1-5 illustrates the IssueTracker data schema.
The person responsible for the schema design needs to understand what the
application does and how it will access the data. This includes knowing which
tables will be accessed most and how often data will be accessed. During devel-
opment, the schema designer will also be responsible for creating primary keys,
indexes, and stored procedures. There will always be minor changes to the data-
base schema; however, you should complete the overall schema design before
the component-level design begins.
The component-level design is where most of the real design time goes. Starting
with the high-level architecture, you need to expand each block into detailed
class definitions. Each class definition will have private and public data as well
as private and public methods. Implementing the principles of object-oriented
design will improve overall reusability and extensibility.
14
0465ch01.qxd 7/19/03 3:22 PM Page 15
15
0465ch01.qxd 7/19/03 3:22 PM Page 16
Chapter 1
Collection
Stored Procedure of
Business Style
Enterprise Stored Procedure Objects Single Windows Form Sheet
Database Stored Procedure Business or
Object Web Page User
Stored Procedure
Control
Validation
DataSet
Each of the following chapters focuses on and develops a specific part of the
framework as it fits into the IssueTracker application. You can leverage the best-
practice design patterns from these examples and build a variety of enterprise
applications including supply-chain solutions, e-commerce solutions, and
enterprise resource planning systems.
16
0465ch01.qxd 7/19/03 3:22 PM Page 17
17
0465ch01.qxd 7/19/03 3:22 PM Page 18
Chapter 1
Data Access: This project performs the function of retrieving data from
and sending data to the database. It accomplishes this using ADO.NET
data access objects and SQL Server stored procedures.
ASP.NET Web Service: The Web Service project provides public Web
interfaces that are accessible to Web service clients. It can be present
independent of the type of user interface (such as a Web client or a
Windows client), if any, used in your application. It is one of the ways of
remoting application servers. This project is similar to the Business
Facade layer except that other Web service clients access its methods,
which means it is not limited to being accessed by other parts of the
application.
18
0465ch01.qxd 7/19/03 3:22 PM Page 19
Select Enterprise Template Projects from the Project Types list box. Next, select
Visual C# Simple Distributed Application from the Templates list. Finally, enter
IssueTracker in the Name box (as shown previously in Figure 1-7), and click the
OK button. Visual Studio .NET will prompt you for a Uniform Resource Locator
(URL) that points to an Internet Information Server (IIS) location, as illustrated
in Figure 1-8. In most cases, the default localhost setting is fine.
Figure 1-8. Visual Studio .NET can store Web projects on any accessible IIS Web
server.
Visual Studio .NET will quickly generate the new solution in different loca-
tions. The bulk of the source code will appear within the following location:
The generated Web service project code will appear within the following
location:
\inetpub\wwwroot\IssueTracker\IssueTracker_WebService
19
0465ch01.qxd 7/19/03 3:22 PM Page 20
Chapter 1
The generated Web application project code will appear within the following
location:
\inetpub\wwwroot\IssueTracker\IssueTracker_WebUI
The IssueTracker solution contains seven projects that implement the busi-
ness facade, business rules, data access, system framework access, Web user
interface, and desktop user interface. As the development of the IssueTracker
application continues, new projects will appear within the same solution. Visual
Studio .NET displays each project in the Solution Explorer, as illustrated in
Figure 1-9.
Once the solution has been created, development of the IssueTracker enter-
prise application can begin. Over the next few chapters, you will fill in the
individual projects under this solution that handle database access, directory ser-
vices accessibility, messaging, business process automation, e-mail support, and
the user interface. Each project will be complete with source code and a test utility.
20
0465ch01.qxd 7/19/03 3:22 PM Page 21
Summary
As long as there are large businesses, there will always be a need for enterprise
applications. This chapter started by defining an enterprise application. Next it
described some of the technologies involved in building an enterprise applica-
tion, such as database access, directory services, messaging services, mail
services, process automation, reporting, and user interfacing. The chapter also
explained how enterprise applications are designed and how you can use
Microsoft’s .NET Framework to support rapid development. Finally, the chapter
introduced the IssueTracker enterprise application that you will incrementally
develop with each chapter of this book.
In the next chapter, you will be exposed to the data services of a .NET enter-
prise application. You will learn how a structured data access framework can
accelerate the development time of data-centric applications. You will also see
how you can use certain .NET characteristics—such as properties, collections,
and reflection—to implement business objects and an intelligent business
object manager.
21