What should you do?

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010.

The application contains a grid that displays customer data stored in a database table. Users report that the grid takes a long time to display.

You plan to implement data caching to improve loading time for the grid.

You need to ensure that the cached data expires when the customer data is updated.

What should you do?

You are developing an application by using Microsoft .NET Framework 4 and Microsoft Visual Studio 2010.

The application contains a grid that displays customer data stored in a database table. Users report that the grid takes a long time to display.

You plan to implement data caching to improve loading time for the grid.

You need to ensure that the cached data expires when the customer data is updated.

What should you do?

A.
Use the System.Web.Caching.CacheDependency class.

B.
Use the System.Runtime.Caching.SqlChangeMonitor class.

C.
Use the ADO.NET Entity Framework.

D.
Use a static variable to store the Grid object.

Explanation:
Requirements:
Improve loading time for the grid. You need to ensure that the cached data expires when the customer data is updated.
A: CacheDependency class: it’s a filewatcher one => out
B: Runtime.Caching.SqlChangeMonitor: class Monitors changes to a database. You can use the CacheItemPolicy to specify expiration policies. page 190 => Yes
C: Use the ADO.NET Entity Framework: I wouldn’t advise it (caching Entity). The ObjectContext needs to be active to observe changes to any entities you are actively working with or you’d need to disconnect any active entities prior to caching the ObjectContext. Detaching could work provided the original context is disposed properly => out
D: Use a static variable to store the Grid object: Won’t help to impove loading time => out



Leave a Reply 0

Your email address will not be published. Required fields are marked *