Microsoft .NET was designed to make it easier to create applications that are distributed across a heterogeneous network such as the Internet. .NET alters the Windows programming model, in that applications run inside the .NET environment rather than directly on top of the operating system. This .NET environment is called the Common Language Runtime (CLR).
.NET provides developers with a rich collection of classes called the Base Class Library (BCL). The BCL is part of the .NET Framework, which provides a core set of services to .NET applications, including classes for the Windows user interface (called Windows Forms), a database (called ADO .NET), a web user interface (called Web Forms), an XML parser, XML web services, and security components, just to name a few.
XML web services solve many problems associated with distributed applications. Web services use industry standards like XML and SOAP for communication, can communicate over the HTTP protocol to avoid problems with firewalls, and can make it easier for applications developed separately (by different developers) to communicate with each other. Web services are offered by providers and used by consumers.
Visual Studio .NET is a powerful tool for software development. It supports a large set of file and project types, and it has MSDN development help built in to the application. Design tools such as Visio for Enterprise Architects make software design easier by tying together the design and development processes.
.NET Framework acts as a middleware component, running between applications and the operating system.
.NET makes it easier to develop web services applications, which are specifically designed to work over the Internet.
Web services use Internet standards such as XML, SOAP, WSDL, and UDDI.
Web services allow applications developed using different tools to use each others services.
.NET applications can still use COM objects, which allows organizations to introduce .NET gradually into their enterprise architectures.
The .NET Framework is an environment for building, deploying, and running .NET applications.
The Common Language Runtime (CLR) is the execution environment for .NET.
CLR loads, manages, and runs your code, as well as provides a number of essential support services.
.NET applications are not compiled into machine code; they are compiled into assemblies that contain a mixture of Microsoft Intermediate Language (MSIL) and metadata.
The .NET Framework provides the CLR thousands of base classes and type libraries for use during program execution.
Visual Studio .NET ships with four supported languages: Visual C#, Visual C++, Visual Basic, and JScript.
Over 20 languages are currently available or are in development for the CLR.
Some versions of Visual Studio .NET ship with SQL Server, Visual SourceSafe, and Microsoft Visio.
Microsoft is continuing to improve the .NET platform by integrating it more tightly with the operating system and SQL Server.
Third-party developers are working on versions of .NET for Unix systems using the Mono Project.
The following questions will help you measure your understanding of the material presented in this chapter. Read all the choices carefully because there might be more than one correct answer. Choose all correct answers for each question.
1. | What is the primary goal of software design?
|
|
2. | How can managed .NET applications call COM components?
|
|
3. | How can COM components call .NET components?
|
|
4. | Which of the following industry-standard technologies is generally associated with web services? (Choose all that apply.)
|
|
5. | You are designing an order entry application that will be used by your company’s sales force. They have indicated that they would like to be able to enter orders remotely (from customer’s offices) using their Apple PowerBook notebooks or their Windows CE devices over the Internet. There is also a 1-800 call center that enters orders through desktop PCs. Assuming this is being developed in a .NET environment, which of the following remote application types is the best solution?
|
|
Answers
1. | D. The goal of software design is to fulfill user requirements. |
2. | D. .NET applications can call COM components through a runtime callable wrapper (RCW). Using a conversion tool shipped with the .NET Framework, COM components can be imported into any .NET application without recompiling the component. In addition, Visual Basic .NET applications have the special ability to use COM components without having to manually convert them. |
3. | C. COM-compatible environments can access .NET components by creating a COM callable wrapper (CCW) for the component. Although this is not as easy as having .NET applications call COM components, unmanaged Windows applications can call .NET components if they are configured properly. |
4. | A, C, and F. The four technologies most closely associated with web services on that list are XML, SOAP, WSDL, and UDDI. SOAP is the XML-based message format used for service providers and consumers to communicate across the Internet. WSDL is an XML-based data format for describing web services, and UDDI is an industry-standard method for locating businesses and web services across the Internet. |
5. | C. An ASP.NET web site would be the best overall solution for this scenario. All three platforms (Windows desktop, Mac notebook, and Windows CE device) come with full- featured web browsers that support rich functionality. |
6. | Which of the following essential system services does the .NET Framework provide to managed applications? (Choose all that apply.)
|
|
7. | The company you work for has decided to use the .NET platform for any new applications that will be developed. There are a large number of existing applications and components running inside a COM+ environment running on Windows 2000 server. Although many of the applications also will be converted to .NET over the coming months, there are a handful of legacy applications—applications that are still required but are no longer in active development. Which of the following options is the best method for integrating the legacy components with the new .NET environment?
|
|
8. | What is the internal format of .NET assemblies?
|
|
9. | You are a developer working with two components: Cat and Dog. The Cat component was written in Visual C#, while the Dog component was written in JScript .NET. Which of the following would be valid reasons to want to rewrite the Dog component in Visual C#? (Choose all that apply.)
|
|
10. | There are five classes in the .NET Base Class Library named ControlCollection. What is the name of the mechanism in .NET that allows multiple classes with the same class name to coexist?
|
|
Answers
6. | A, B, and C. The .NET Framework provides a core set of essential services to .NET applications, including components that provide access to databases, file systems, and remote applications. |
7. | D. COM components must be wrapped in a runtime callable wrapper (RCW). As the name suggests, these wrappers give the CLR access to unmanaged code inside. |
8. | C. Assemblies contain a detailed type library in the form of metadata, along with intermediate language (IL) code. |
9. | A. JScript .NET programs are created and modified using a simple text editor and turned into an assembly using a command-line compiler. |
10. | D. Multiple classes can exist with the same name as long as they are in separate namespaces. |
11. | Which of the following programming languages can be compiled using the Visual Studio .NET development environment? (Choose all that apply.)
|
|
12. | Joe is a Microsoft Certified Developer who has over five years experience working in the Visual Basic programming language. Joe is the primary developer on a programming team responsible for developing business accounting software. Joe’s boss read an article on .NET and has decided it would be a good idea for the next version of the company’s accounting package to be written in Visual Basic .NET. Why is Visual Basic .NET so different from previous versions of Visual Basic? (Choose all that apply.)
|
|
13. | What are the primary advantages of using Visio for Enterprise Architects when coding in a Visual Studio .NET environment? (Choose all that apply.)
|
|
Answers
11. | A and D. Three programming languages can be edited and compiled using the development tool: VB .NET, C#, and Visual C++. |
12. | A and C. VB .NET is an object-oriented programming language that supports many object-oriented features such as polymorphism, inheritance, and encapsulation. In addition, the language uses .NET Framework classes for everything from GUI form controls to data types. |
13. | B, C, and D. Visio for Enterprise Architects includes many UML and ORM templates to aid in software design. Those templates can then be turned into skeleton code when programming is ready to begin. Existing projects can also be turned into UML classes to make documentation easier. |
14. | Microsoft has announced that the new version of SQL Server, code named Yukon, will include tighter integration between SQL Server and .NET. How will this integration benefit developers?
|
|
15. | Which of the following .NET technologies developed by Microsoft are available as an open standard? (Choose all that apply.)
|
|
Answers
14. | D. The next version of SQL Server is expected to include support for the CLR, which will allow developers to write stored procedures in any .NET language. |
15. | B and C. ECMA International has standardized C# and the CLI. |
1. | ABC Corporation has a wide variety of servers—using many different machines and operating systems—to run its internal applications. It would like to standardize on a single architecture one day, but for now it uses a wide variety of systems to run its operations. The company has an IBM mainframe to handle its centralized data services, a dozen Microsoft Windows 2000 servers to handle its internal and external web sites and applications, and a handful of Sun Unix machines to manage its extensive end-to-end order processing and distribution systems. The IT department has recently decided to move the data services off the mainframe and onto a small cluster of PCs. Your group is in charge of designing the best solution for this large-scale project. You’ve already decided that a move this size will have to be done gradually. Given the number of applications involved and the critical importance of most of those systems, trying to migrate the data store from the mainframe to the server cluster all at once will be way too risky. Given what you know about the migration plan, availability, and performance requirements, what are the benefits of using custom .NET components as a middle layer between the applications and the database? |
|
Answers
1. | Using .NET components as a middle tier between applications and the database can provide several benefits. First, the components can serve as an additional layer of security. The components can block applications and users from gaining access to data they are not supposed to see. The components can also provide security through an extensive audit trail and real-time notification of events. Second, components can implement data caching for frequently called static data, saving execution time. Programmers can include complex intelligence in the component to know how frequently a cache needs to be refreshed and what data should never be cached. Third, data components can perform complex processing that spans several database transactions, ensuring data integrity. For instance, for a bill payment at a bank, a component can be used to ensure that the money is both withdrawn from the client’s account and paid into the correct payee’s account. Fourth, components can perform additional business processing work, reducing the amount of data transmitted over a network. For instance, instead of an application retrieving 100,000 rows of data in order to perform a complex mean and medium calculation on them, the server component can do that calculation without having to transmit so much data to the client requesting the information. The fact that .NET components can be easily wrapped inside an XML web service allows applications developed on different operating systems such as Unix to access the data. It also provides a solid basis for standardization of the enterprise architecture in the future. |