Review Questions

1. 

.NET Enterprise Services offers which of the following services?

  1. Manual transaction processing

  2. Tightly Coupled Events

  3. Windows security

  4. Role-based security

d.net enterprise services offers automatic transaction processing, loosely coupled events, and role-based security to determine which windows group a user belongs to.

2. 

Your application design uses queued components. Which design goal indicates that queued components are the best choice for this application?

  1. Real-time updates from the database.

  2. User interface that is adaptable to many different devices.

  3. Reliable message delivery, but no immediate response required.

  4. Disk read/write performance is optimized.

cqueued components enable you to deliver messages asynchronously to other applications.

3. 

To create a .NET component that will be hosted by COM+, what should you do?

  1. Reference the System.EnterpriseServices namespace.

  2. Reference the System.ComponentServices namespace.

  3. Import the System.COMServices namespace.

  4. Import the System.EnterpriseComponents namespace.

ato enable your components to be hosted by .net enterprise services, you must set a reference to the system.enterpriseservices.dll .

4. 

How can you indicate characteristics of your component to .NET Enterprise Services?

  1. Use the Component property of your class to set these values.

  2. Use the /prop switch when registering your component.

  3. Add methods to your class.

  4. Add attributes to your class.

dthe servicedcomponent class from the .net framework class library defines many attributes that can be added to your assemblies, classes, and methods to set their behavioral characteristics. these attributes, including construction strings and security settings, are referenced by .net enterprise services when the component runs.

5. 

You apply the <ApplicationActivation(ActivationOption.Server)> attribute to your class. What does this mean?

  1. Your component will run in the same process with the calling application.

  2. Your component will run in a different process than the calling application.

  3. Your component will run on the same computer as the calling application.

  4. Your component will run on a different computer than the calling application.

bserver components run in their own process. the activationoption.library option directs the component to run in the caller s process.

6. 

You apply the <ConstructionEnabled(True)> attribute to your class. What does this mean?

  1. Your component can be instantiated only by COM clients.

  2. Your component can be instantiated only by .NET clients.

  3. Your component can be instantiated with parameters supplied at runtime.

  4. Your component can be instantiated with parameters from the Component Services management dialog box.

dthe constructionenabled attribute indicates that certain runtime parameters will be entered into the component services dialog box.

7. 

Given this attribute setting:

<ObjectPooling(Enabled:=True, MinPoolSize:=10, MaxPoolSize:=20)>

What can you say about the object’s behavior?

  1. If there are more than 10 concurrent requests for an object, object pooling will activate.

  2. If there are fewer than 20 concurrent requests for an object, object pooling will not activate.

  3. If there are fewer than 10 concurrent requests for an object, object pooling will not activate.

  4. There will always be at least 10 objects in the pool waiting for activation, but no more than 20.

dobject pooling enables you to specify the number of objects that can be ready and waiting when a client asks to instantiate an object.

8. 

The definition of a transaction states that there are four important properties of transactions. Which of these is one of those properties?

  1. Absolute

  2. Consistent

  3. Individual

  4. Distributed

bthe acid properties state that a transaction must be consistent, which means that data integrity must be maintained when a transaction is completed. the other acid properties are atomicity, isolation, and durability.

9. 

You have created a component with attributes that state that a transaction is required. Which scenario best describes how your component works?

  1. Each time an object from this class is instantiated, the object will start a new transaction.

  2. Each time an object from this class is instantiated, the object will join an existing transaction or start a new transaction if none exists.

  3. If there is no existing transaction when this class is instantiated, a runtime error will occur.

  4. If another transaction is running when this class is instantiated, a runtime error will occur.

b transactionoption.required means that an object must run in the context of a transaction. if there is an existing transaction, the object will join that transaction. otherwise, a new transaction will be started. if you always want to start a new transaction, use the requiresnew option instead of required .

10. 

You create a .NET component that will be used by Component Services. What effect will the <AutoComplete(True)> attribute have on your component’s behavior?

  1. This attribute affects the way synchronization is handled.

  2. This attribute affects the way object construction is handled.

  3. This attribute affects the way object pooling is handled.

  4. This attribute affects the way transaction outcome is handled.

dthe autocomplete attribute states that if a given method completes successfully, the transaction vote for that object will be automatically set to commit the transaction. if any exception occurs, then the vote will be set to abort (or roll back) the transaction.

11. 

You have created a .NET component that will be used by COM clients. What step should you take to make the component accessible to COM?

  1. Import your component’s custom interface.

  2. Export your component’s custom interface.

  3. Import the IDispatch and IUnknown interfaces for your component.

  4. Export the IDispatch and IUnknown interfaces for your component.

bin order for com clients to use your component, you must export your component s custom interface by using the type library export tool ( tlbexp.exe ). the .net runtime handles creation of idispatch and iunknown interfaces for your component, for use by com clients. you would import a com component s type library in order to access that com component from a .net project.

12. 

Before your .NET component can be used by Component Services, what step must you take?

  1. Register the component by using the regsvcs.exe utility.

  2. Register the component by using the regsvr32.exe utility.

  3. No special steps are required as long as your component has a reference to System.EnterpriseSerivces.dll.

  4. No special steps are required as long as your component imports the System.EnterpriseSerivces namespace.

ain order for component services to use a .net component, the component must have an entry in the windows system registry; this does not happen automatically. the regsvcs.exe utility that is provided with the .net framework does this. the regsvr32.exe utility can be used to register only a com dll.

13. 

You have created a .NET component that will be used by COM clients. Which .NET Framework namespace must you import in your code to support this capability?

  1. System.Runtime.Serialization

  2. System.Runtime.InteropServices

  3. System.Reflection

  4. System.EnterpriseServices

bthe system.runtime.interopservices supports interoperability with com components and clients. the system.runtime.serialization namespace includes functions to serialize and deserialize objects for storage and transport. system.reflection allows access to underlying types. system.enterpriseservices makes available component services, such as queued components, transactions, and so on.

14. 

You would like to use an existing COM component in your Visual Studio .NET project. When you add a reference to the COM DLL, what action does Visual Studio .NET take?

  1. Visual Studio .NET creates a .NET interop assembly in your project’s \bin directory.

  2. Visual Studio .NET creates a .NET interop assembly in your project’s \obj directory.

  3. Visual Studio .NET creates a COM type library in your project directory.

  4. Visual Studio .NET creates a new class module in your project directory.

avisual studio .net creates a .net interop assembly called interop.projectname.dll , in your project s \ bin directory.

15. 

You would like to call functions from one of the Windows system DLLs from your Visual Studio .NET application. How do you accomplish this?

  1. Create a class in your project that contains the Win32 API declaration. When you want to call the function, instantiate an object from that class and make a method call on the object.

  2. Create a class in your project that contains the Win32 API declaration. When you want to call the function, instantiate an object called Win32Interop and make a method call on the object.

  3. Put the Win32 API declaration at the top of the main module in your project. When you want to call the function, use the code PInvoke.functionname.

  4. Create a class in your project that contains the Win32 API declaration. When you want to call the function, instantiate an object called PInvoke and make a method call on the object.

awhen calling win32 api functions (or calling any functions in an unmanaged dll), you should create a class in your visual studio .net project, which contains the win32 function declaration. you can then instantiate objects from that class, and any functions declared in that class are seen as methods of your object.

Answers

1. 

D .NET Enterprise Services offers automatic transaction processing, Loosely Coupled Events, and role-based security to determine which Windows group a user belongs to.

2. 

C Queued components enable you to deliver messages asynchronously to other applications.

3. 

A To enable your components to be hosted by .NET Enterprise Services, you must set a reference to the System.EnterpriseServices.dll.

4. 

D The ServicedComponent class from the .NET Framework class library defines many attributes that can be added to your assemblies, classes, and methods to set their behavioral characteristics. These attributes, including construction strings and security settings, are referenced by .NET Enterprise Services when the component runs.

5. 

B Server components run in their own process. The ActivationOption.Library option directs the component to run in the caller’s process.

6. 

D The ConstructionEnabled attribute indicates that certain runtime parameters will be entered into the Component Services dialog box.

7. 

D Object pooling enables you to specify the number of objects that can be “ready and waiting” when a client asks to instantiate an object.

8. 

B The ACID properties state that a transaction must be consistent, which means that data integrity must be maintained when a transaction is completed. The other ACID properties are Atomicity, Isolation, and Durability.

9. 

B TransactionOption.Required means that an object must run in the context of a transaction. If there is an existing transaction, the object will join that transaction. Otherwise, a new transaction will be started. If you always want to start a new transaction, use the RequiresNew option instead of Required.

10. 

D The AutoComplete attribute states that if a given method completes successfully, the transaction vote for that object will be automatically set to commit the transaction. If any exception occurs, then the vote will be set to abort (or roll back) the transaction.

11. 

B In order for COM clients to use your component, you must export your component’s custom interface by using the Type Library Export tool (tlbexp.exe). The .NET runtime handles creation of IDispatch and IUnknown interfaces for your component, for use by COM clients. You would import a COM component’s type library in order to access that COM component from a .NET project.

12. 

A In order for Component Services to use a .NET component, the component must have an entry in the Windows system Registry; this does not happen automatically. The regsvcs.exe utility that is provided with the .NET Framework does this. The regsvr32.exe utility can be used to register only a COM DLL.

13. 

B The System.Runtime.InteropServices supports interoperability with COM components and clients. The System.Runtime.Serialization namespace includes functions to serialize and deserialize objects for storage and transport. System.Reflection allows access to underlying types. System.EnterpriseServices makes available Component Services, such as queued components, transactions, and so on.

14. 

A Visual Studio .NET creates a .NET interop assembly called Interop.Projectname.dll, in your project’s \bin directory.

15. 

A When calling Win32 API functions (or calling any functions in an unmanaged DLL), you should create a class in your Visual Studio .NET project, which contains the Win32 function declaration. You can then instantiate objects from that class, and any functions declared in that class are seen as methods of your object.



MCAD/MCSD(c) Visual Basic. NET XML Web Services and Server Components Study Guide
MCAD/MCSD: Visual Basic .NET XML Web Services and Server Components Study Guide
ISBN: 0782141935
EAN: 2147483647
Year: 2005
Pages: 153

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