Summary


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.

Two-Minute Drill

Introducing .NET

  • .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.

.NET Framework

  • 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 Software Design Tools

  • 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.

Future .NET Directions

  • 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.

Self Test

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.

Introducing .NET

1.

What is the primary goal of software design?

  1. Create an application that is secure

  2. Create an application that is easy to maintain in the future

  3. Adhere to the Microsoft Solution Framework

  4. Create an application that fulfills business requirements

 d . the goal of software design is to fulfill user requirements. x a and b are incorrect because they are secondary requirements. creating an application that is secure and can be easily maintained means nothing if the application cannot do the basic tasks required of it. c is incorrect because the microsoft solution framework is only one way to achieve the goal of good software design and is not the goal itself.

2.

How can managed .NET applications call COM components?

  1. .NET applications are designed to be compatible with COM technology.

  2. COM components can be called using the Assembly-COM Interface Layer (ACIL).

  3. COM components can be called through a COM callable wrapper (CCW).

  4. COM components can be called through a runtime callable wrapper (RCW).

 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. x a is incorrect because com components and .net assemblies do not have inherent compatibility. b is incorrect because there is no such thing as the assembly-com interface layer. c is incorrect because com callable wrappers (ccw) allow com-compatible environments to use a .net component but not the other way around.

3.

How can COM components call .NET components?

  1. .NET applications are designed to be compatible with COM technology.

  2. They can’t; the two technologies are incompatible.

  3. .NET components can be called through a COM callable wrapper (CCW).

  4. .NET components can be called through a runtime callable wrapper (RCW).

 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. x a is incorrect because com components and .net assemblies do not have inherent compatibility. b is incorrect because unmanaged windows applications such as com objects can indeed call .net components if they are properly set up. d is incorrect because runtime callable wrappers (rcw) allow .net applications to use com components but not the other way around.

4.

Which of the following industry-standard technologies is generally associated with web services? (Choose all that apply.)

  1. XML

  2. HTML

  3. SOAP

  4. COM/DCOM

  5. XSLT

  6. WSDL/UDDI

 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. x b is incorrect because html deals primarily with human-readable web pages. d is incorrect because although com and dcom often allow applications to be distributed across a network, those applications are based on com and not xml. e is incorrect because xslt concerns itself with translating xml documents into other xml-related formats. although xslt may be used for formatting soap messages, it is an xml technology and not a web service technology.

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?

  1. A client application that connects using Distributed COM

  2. A client application that connects using XML web services

  3. A simple web browser client that connects to an ASP.NET application

  4. A two-tier client application that connects directly to the database using ODBC

 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. x a is incorrect because not all platforms support com/dcom (such as the mac os). dcom applications are also difficult to implement across a slow and unreliable network such as the internet. b is incorrect because xml web services require a separate client to be developed for each of the three os platforms. security would also have to be implemented manually. d is incorrect because clients would have to be developed for each of the three os platforms, and not all platforms support odbc (such as mac os). also, security would have to be implemented manually in this scenario.

Answers

1.

D. The goal of software design is to fulfill user requirements.
x A and B are incorrect because they are secondary requirements. Creating an application that is secure and can be easily maintained means nothing if the application cannot do the basic tasks required of it. C is incorrect because the Microsoft Solution Framework is only one way to achieve the goal of good software design and is not the goal itself.

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.
x A is incorrect because COM components and .NET assemblies do not have inherent compatibility. B is incorrect because there is no such thing as the Assembly-COM Interface Layer. C is incorrect because COM callable wrappers (CCW) allow COM-compatible environments to use a .NET component but not the other way around.

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.
x A is incorrect because COM components and .NET assemblies do not have inherent compatibility. B is incorrect because unmanaged Windows applications such as COM objects can indeed call .NET components if they are properly set up. D is incorrect because runtime callable wrappers (RCW) allow .NET applications to use COM components but not the other way around.

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.
x B is incorrect because HTML deals primarily with human-readable web pages. D is incorrect because although COM and DCOM often allow applications to be distributed across a network, those applications are based on COM and not XML. E is incorrect because XSLT concerns itself with translating XML documents into other XML-related formats. Although XSLT may be used for formatting SOAP messages, it is an XML technology and not a web service technology.

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.
x A is incorrect because not all platforms support COM/DCOM (such as the Mac OS). DCOM applications are also difficult to implement across a slow and unreliable network such as the Internet. B is incorrect because XML web services require a separate client to be developed for each of the three OS platforms. Security would also have to be implemented manually. D is incorrect because clients would have to be developed for each of the three OS platforms, and not all platforms support ODBC (such as Mac OS). Also, security would have to be implemented manually in this scenario.

.NET Framework

6.

Which of the following essential system services does the .NET Framework provide to managed applications? (Choose all that apply.)

  1. Database access

  2. File system access

  3. Access to remote applications

  4. Type library (TLB) to MSIL assembly conversion

 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. x d is incorrect because .net can only interact with com components that have already been converted to assemblies. usually a developer performs conversion manually before integrating com components into .net application development.

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?

  1. Since COM components are unmanaged code, they cannot be called by .NET applications.

  2. As long as the COM components and .NET applications are running on the same server, it will work as is.

  3. .NET applications can call COM components as long as they are in a COM callable wrapper (CCW).

  4. .NET applications can call COM components as long as they are in a runtime callable wrapper (RCW).

 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. x a is incorrect because, with the right configuration, .net and com can call each other s objects. b is incorrect because .net applications can access both local and remote com objects as long as they are properly configured. c is incorrect because com callable wrappers (ccw) allow com objects to call managed code inside .net.

8.

What is the internal format of .NET assemblies?

  1. Microsoft Intermediate Language (MSIL) only

  2. CPU-specific executables

  3. A combination of metadata and intermediate language code

  4. XML

 c . assemblies contain a detailed type library in the form of metadata, along with intermediate language (il) code. x a is incorrect because assemblies contain a lot of information besides the compiled il code. metadata provides other applications with details on the name and type of properties and methods within the object. developers can also insert their own metadata into the file. b is incorrect because assemblies are not cpu specific. the process of just-in-time compiling is what turns an assembly into machine-specific code. d is incorrect because assemblies are a binary format and not xml.

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.)

  1. JScript components cannot be edited within the Visual Studio IDE.

  2. JScript components cannot be used by Visual C# applications.

  3. Components written in other languages cannot be used as base classes.

  4. JScript components run slower than Visual C# components.

 a . jscript .net programs are created and modified using a simple text editor and turned into an assembly using a command-line compiler. x b is incorrect because all .net languages are compiled to intermediate language, and they are all able to interoperate equally well with each other. c is incorrect for the same reason. in any .net language, you can inherit from classes written in other languages. d is incorrect because, in general, no programming language can gain a significant performance advantage over any other programming language-with the possible exception of visual c++, which has the ability to use unmanaged code for performance-critical operations.

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?

  1. Class overriding

  2. Class overloading

  3. Inheritance

  4. Namespaces

 d . multiple classes can exist with the same name as long as they are in separate namespaces. x a and b are incorrect because overriding and overloading are actions performed on methods and not classes. c is incorrect because inheritance allows one class to extend the members of another and has nothing to do with how those classes are named.

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.
x D is incorrect because .NET can only interact with COM components that have already been converted to assemblies. Usually a developer performs conversion manually before integrating COM components into .NET application development.

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.
x A is incorrect because, with the right configuration, .NET and COM can call each other’s objects. B is incorrect because .NET applications can access both local and remote COM objects as long as they are properly configured. C is incorrect because COM callable wrappers (CCW) allow COM objects to call managed code inside .NET.

8.

C. Assemblies contain a detailed type library in the form of metadata, along with intermediate language (IL) code.
x A is incorrect because assemblies contain a lot of information besides the compiled IL code. Metadata provides other applications with details on the name and type of properties and methods within the object. Developers can also insert their own metadata into the file. B is incorrect because assemblies are not CPU specific. The process of just-in-time compiling is what turns an assembly into machine-specific code. D is incorrect because assemblies are a binary format and not XML.

9.

A. JScript .NET programs are created and modified using a simple text editor and turned into an assembly using a command-line compiler.
x B is incorrect because all .NET languages are compiled to intermediate language, and they are all able to interoperate equally well with each other. C is incorrect for the same reason. In any .NET language, you can inherit from classes written in other languages. D is incorrect because, in general, no programming language can gain a significant performance advantage over any other programming language—with the possible exception of Visual C++, which has the ability to use unmanaged code for performance-critical operations.

10.

D. Multiple classes can exist with the same name as long as they are in separate namespaces.
x A and B are incorrect because overriding and overloading are actions performed on methods and not classes. C is incorrect because inheritance allows one class to extend the members of another and has nothing to do with how those classes are named.

Visual Studio .NET Software Design Tools

11.

Which of the following programming languages can be compiled using the Visual Studio .NET development environment? (Choose all that apply.)

  1. Visual C#

  2. Mono

  3. JScript

  4. Visual C++

 a and d . three programming languages can be edited and compiled using the development tool: vb .net, c#, and visual c++. x b is incorrect because mono is not a programming language; it is an open-source, cross-platform version of the .net platform. c is incorrect because jscript is compiled using a command-line tool and is not part of the development environment.

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.)

  1. VB .NET is fully object oriented, while previous versions were not.

  2. VB .NET is an interpreted language, while VB6 was compiled.

  3. VB .NET calls base classes to perform most common tasks instead of using external COM objects like ADO and MSXML.

  4. Since .NET is a managed environment, VB .NET does not support COM+ features like transactions and object pooling.

 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. x b is incorrect because vb .net is indeed compiled. .net applications are compiled into assemblies and compiled again using jit compiling before runtime. d is incorrect because vb .net components can be imported as com callable wrappers into com+ for services such as transactions and object pooling.

13.

What are the primary advantages of using Visio for Enterprise Architects when coding in a Visual Studio .NET environment? (Choose all that apply.)

  1. Developers can write applications in Visio without having to learn another programming language.

  2. Visio includes many software design templates for UML and ORM.

  3. UML class diagrams can be converted into skeleton classes for Visual C#, Visual C++, and Visual Basic .NET.

  4. Visio can reverse-engineer .NET projects to create UML class diagrams.

 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. x a is incorrect because visio only allows you to design software. programming will still have to be done using a traditional programming language such as visual basic .net, visual c#, or visual c++.

Answers

11.

A and D. Three programming languages can be edited and compiled using the development tool: VB .NET, C#, and Visual C++.
x B is incorrect because Mono is not a programming language; it is an open-source, cross-platform version of the .NET platform. C is incorrect because JScript is compiled using a command-line tool and is not part of the development environment.

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.
x B is incorrect because VB .NET is indeed compiled. .NET applications are compiled into assemblies and compiled again using JIT compiling before runtime. D is incorrect because VB .NET components can be imported as COM callable wrappers into COM+ for services such as transactions and object pooling.

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.
x A is incorrect because Visio only allows you to design software. Programming will still have to be done using a traditional programming language such as Visual Basic .NET, Visual C#, or Visual C++.

Future .NET Directions

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?

  1. A full version of SQL Server will ship with Visual Studio .NET.

  2. Instead of using ADO .NET, applications will be able to access SQL Server using a special web service.

  3. SQL Server Enterprise Manager will be one of the project templates available in Visual Studio.

  4. Developers will be able to write stored procedures using Visual C#, Visual C++, or Visual Basic .NET instead of SQL.

 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. x a and c are incorrect because microsoft has not announced these features. in any event, given the fundamentally different purposes of sql server and visual studio .net, it would not make sense for this to happen. b is incorrect because providing database access through a web service would be slower and less flexible.

15.

Which of the following .NET technologies developed by Microsoft are available as an open standard? (Choose all that apply.)

  1. Visual Basic

  2. C#

  3. Common Language Infrastructure (CLI)

  4. Java

 b and c . ecma international has standardized c# and the cli. x a is incorrect because visual basic is a proprietary microsoft technology. d is incorrect because java belongs to sun microsystems and is not related to microsoft s .net platform.

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.
x A and C are incorrect because Microsoft has not announced these features. In any event, given the fundamentally different purposes of SQL Server and Visual Studio .NET, it would not make sense for this to happen. B is incorrect because providing database access through a web service would be slower and less flexible.

15.

B and C. ECMA International has standardized C# and the CLI.
x A is incorrect because Visual Basic is a proprietary Microsoft technology. D is incorrect because Java belongs to Sun Microsystems and is not related to Microsoft’s .NET platform.

Lab Question

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?

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.

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.




MCSD Analyzing Requirements and Defining. NET Solutions Architectures Study Guide (Exam 70-300)
MCSD Analyzing Requirements and Defining .NET Solutions Architectures Study Guide (Exam 70-300 (Certification Press)
ISBN: 0072125861
EAN: 2147483647
Year: 2003
Pages: 94

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