The Role of C in .NET Enterprise Architecture

 
Chapter 1 - C# and .NET Architecture
bySimon Robinsonet al.
Wrox Press 2002
  

The Role of C# in .NET Enterprise Architecture

C# requires the presence of the .NET runtime, and it will probably be a few years before most clients - particularly most home machines - have .NET installed. In the meantime, installing a C# application is likely to mean also installing the .NET redistributable components . Because of that, it is likely that the first place we will see many C# applications is in the enterprise environment. Indeed, C# arguably presents an outstanding opportunity for organizations that are interested in building robust, n-tiered client-server applications.

When combined with ADO.NET , C# has the ability to quickly and generically access data stores like SQL Server and Oracle databases. The returned datasets can easily be manipulated via the ADO.NET object model, and automatically render as XML for transport across an office intranet.

Once a database schema has been established for a new project, C# presents an excellent medium for implementing a layer of data access objects, each of which could provide insertion, updates, and deletion access to a different database table.

Because it's the first component-based C language, C# is a great language for implementing a business object tier , too. It encapsulates the messy plumbing for inter-component communication, leaving the developer free to focus on gluing their data access objects together in methods that accurately enforce his organization's business rules. Moreover, with attributes, C# business objects can be outfitted for method-level security checks, object pooling, and JIT activation supplied by COM+ Services. Furthermore, .NET ships with utility programs that allow your new .NET business objects to interface with legacy COM components.

To create an enterprise application with C#, you'd probably create a Class Library project for the data access objects and another for the business objects. While developing, you could use Console projects to test the methods on your classes. Fans of extreme programming could build Console projects that could be automatically executed from batch files to unit test that working code has not been broken.

On a related note, C# and .NET will probably influence the way that you physically package your reusable classes. In the past, many developers crammed a multitude of classes into a single physical component because this arrangement made deployment a lot easier; if there was a versioning problem, you knew just where to look. Because deploying .NET enterprise components simply involves copying files into directories, developers can now package their classes into more logical, discrete components without encountering "DLL Hell".

Last but not least, ASP.NET pages coded in C# constitute an excellent medium for user interfaces. Because ASP.NET pages compile, they execute quickly. Because they can be debugged in the VS.NET IDE, they are robust. Because they support full-scale language features like early binding, inheritance, and modularization , ASP.NET pages coded in C# are tidy and easily maintained .

Seasoned developers acquire a healthy skepticism about strongly hyped new technologies and languages, and are reluctant to utilize new platforms simply because they are urged to. If you're an enterprise developer in an IT department, though, or if you provide application services across the World Wide Web, let me assure you that C# and .NET offer at least four solid benefits, even if some of the more exotic features like Web Services and server-side controls don't pan out:

  • Component conflicts will become infrequent and deployment will be easier, because different versions of the same component can run side by side on the same machine without conflicting

  • Your ASP code won't look like spaghetti anymore

  • You can leverage a lot of the functionality in the .NET base classes

  • For applications requiring a Windows Forms user interface, C# makes it very easy to write this kind of application

Windows Forms have to some extent been downplayed in the last year due to the advent of WebForms and Internet-based applications. However, if you or your colleagues lack expertise in JavaScript, ASP, or related technologies, then Windows Forms are still a viable option for creating a user interface with speed and ease. Just remember to factor your code so that the user interface logic is separate from the business logic and the data access code. Doing so will allow you to migrate your application to the browser at some point in the future if you need to do so. Also, it is likely that Windows Forms will remain the dominant user interface for applications for use in homes and small businesses for a long time to come.

  


Professional C#. 2nd Edition
Performance Consulting: A Practical Guide for HR and Learning Professionals
ISBN: 1576754359
EAN: 2147483647
Year: 2002
Pages: 244

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net