ASP.NET Lecture 7


Published on

This lecture presents:
Object relational Mapping (ORM)
Caching Techniques includes output caching, fragment caching and data caching

Published in: Technology
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Try customer example
  • ASP.NET Lecture 7

    1. 1. ASP.NET 4.0Julie IskanderMSC. Communication and Electronics
    2. 2. Lecture Outlines Object relational Mapping (ORM) Caching
    3. 3. Object relational Mapping (ORM) Is a mechanism that makes it possible to address and manipulate objects without having to consider how these objects relate to their data sources. Manages the mapping details between a set of objects and underlying Relation Database, XWL,……, or any data store.
    4. 4. Object relational Mapping (ORM)
    5. 5. Convert from an HTML to an aspx page
    6. 6. Object relational Mapping (ORM)Tools Types: ◦ Microsoft ORM  Entity FrameWork  LINQ ◦ Third-Party ORM  ORM.Net  NHibernate
    7. 7. Caching
    8. 8. Caching Storing an in-memory copy of expensive information . Better Performance because information retrieval time is cut down dramatically. Better Scalability because more simultaneous page requests can be served with fewer database operations May cause low memory ◦ slows down the entire system. ◦ To prevent this, ASP.NET remove objects when memory gets scarce. ◦ (Self-sufficiency) Can cache ◦ completely rendered HTML for a page, ◦ a portion of that HTML, ◦ arbitrary objects.
    9. 9. Types of Caching Output Caching Data Caching
    10. 10. Output CachingSpecific QueryString ParametersDisadvantages: wont’t work with user-specificpages won’t work with event-driven pages
    11. 11. Custom Output Caching
    12. 12. Fragment Caching Create a user control for the portion of the page you want to cache. Add the OutputCache directive to the user control. Cannot interact with the user-control in code. A block of HTML is simply inserted into the page, user control object isnot available.
    13. 13. Other Caching techniques Post-Cache Substitution ◦ Pages 485-487 in Pro ASP.NET 4
    14. 14. Caching Configurations
    15. 15. Data Caching Add items that are expensive to create to a special built-in collection object (called Cache). This object works much like the Application object. Globally available to all requests from all clients in the application. Difference between Application and Cache Objects: ◦ Items in the cache are removed automatically Always check if a cached object exists before attempting to use it. Stored in process, and won’t persist if the application domain is restarted.
    16. 16. Lab #7 Finish previous labs Add caching to Bookie website as you see appropriate.
    17. 17. REFERENCES [1] Beginning ASP.NET 4 In C# 2010, Matthew Macdonald, Apress [2] Web Application Architecture Principles, Protocols And Practices, Leon Shklar And Richard Rosen, Wiley [3] Professional AS P.NE T 4 In C# And VB, Bill Evjen, Scott Hanselman And Devin Rader, Wiley [4] Pro ASP.NET In C# 2010, Fourth Edition,matthew Macdonald, Adam Freeman, And Mario Szpuszta, Apress