Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. Composed Business Objects

Composed Business Objects

Scheduled Pinned Locked Moved Design and Architecture
csharpdesignhelpquestionasp-net
23 Posts 4 Posters 32 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Mark Churchill

    A really simplistic implementation would be to add the caching to your UserManager.Load(object pk). Check the cache, and if its in the cache then return it. Otherwise load the object's data and add it to the cache. You can use a Dictionary for your cache for prototyping. ASP.Net provides a cache (I think you can safely use this outside of the web framework too) that you can add objects to with a key and an expiry. You might want to add some way of forcing a reload of an object as well. To be honest though if you are writing your own data layer you are going to have to draw the line for features somewhere. I haven't done a KLOC count on Diamond Binding for a while - but I'm guessing its approaching the millions, and thats not including NHibernate ;)

    Mark Churchill Director Dunn & Churchill

    P Offline
    P Offline
    Pawel Krakowiak
    wrote on last edited by
    #21

    Mark Churchill wrote:

    A really simplistic implementation would be to add the caching to your UserManager.Load(object pk). Check the cache, and if its in the cache then return it. Otherwise load the object's data and add it to the cache.

    Sure, but I am concerned with the stateless behavior of web application / HTTP. As far as I know when the page is pushed back to the calling browser, it is disposed of and doesn't exist anymore, hence I am not sure how to cache data, otherwise than in some process which runs all the time on the server. Honestly, I haven't been playing with cache mechanisms of .NET yet, it's something on my list.

    Kind regards, Pawel Krakowiak

    M 1 Reply Last reply
    0
    • P Pawel Krakowiak

      Mark Churchill wrote:

      A really simplistic implementation would be to add the caching to your UserManager.Load(object pk). Check the cache, and if its in the cache then return it. Otherwise load the object's data and add it to the cache.

      Sure, but I am concerned with the stateless behavior of web application / HTTP. As far as I know when the page is pushed back to the calling browser, it is disposed of and doesn't exist anymore, hence I am not sure how to cache data, otherwise than in some process which runs all the time on the server. Honestly, I haven't been playing with cache mechanisms of .NET yet, it's something on my list.

      Kind regards, Pawel Krakowiak

      M Offline
      M Offline
      Mark Churchill
      wrote on last edited by
      #22

      .Net is rather nice and makes it fairly easy for you. I found this article when I googled for the MSDN pages for Context.Cache, and it seemed easier to read anyway: http://www.developer.com/net/net/article.php/1477771[^] The guy does it a bit oddly though, giving a server too busy when it can't find the cached item (I'd go for a GetQuotes method myself that checks and updates the cache). HTH

      Mark Churchill Director Dunn & Churchill

      1 Reply Last reply
      0
      • M martin_hughes

        Slightly OT... But I was wondering, how does Diamon Binding differ/compare to the ADO.Net Entity Framework coming up in VS2008?

        Me: Can you see the "up" arrow? User:Errr...ummm....no. Me: Can you see an arrow that points upwards? User: Oh yes, I see it now! -Excerpt from a support call taken by me, 08/31/2007

        M Offline
        M Offline
        Mark Churchill
        wrote on last edited by
        #23

        I guess the cheeky reply is that Diamond Binding is avaliable now, and is mature, and leveraging Hibernate, which is also decades mature. Last I heard the Entity Framework was dropped from Orcas and was going to be released "out-of-band" sometime in the first half of 2008. EF, like a lot of ORM products tends to be very heavyweight and favours model-first development. It is a very complex product, however I think the key feature that everyone is interested in is LINQ to Entities. LINQ is not really EF specific. After the product becomes more mature, we will look at including LINQ support in Diamond Binding. Although we find that Expressions and HQL support cover most use cases sufficiently at the moment. DB is designed with simplicity in mind, and is geared towards keeping your business objects synchronised with the database schema, and handling everything in between for you. If the schema changes, its a one-click synchronisation. One aim is to stop developers getting bogged down in mapping, and just let them add business value to the application!

        Mark Churchill Director Dunn & Churchill

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups