Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:32:55+00:00 2026-05-26T14:32:55+00:00

Not sure if there’s a offical name, but by DataContext I mean an object

  • 0

Not sure if there’s a “offical” name, but by DataContext I mean an object which transparently maintains objects’ state, providing change tracking, statement-of-work functionality, concurrency and probably many other useful features. (In Entity Framework it’s ObjectContext, in NHibernate – ISession).

Eventually I’ve come to an idea that something like that should be implemented in my application (it uses mongodb as back-end, and mongodb’s partial updates are fine when we’re able to track a certain property change).

So actually, I’ve got several questions on this subject

  1. Could anyone formulate requirements to DataContext? – what’s your understanding of it’s tasks and responsibilities? (The most relevant I’ve managed to find is Esposito’s book, but unfortunately that’s at about msdn samples level).

  2. What would you suggest for changes tracking implementation? (In simplest way it’s possible to track changes “manually” in entities, but requires coding and mixes dal with business logic, so I mostly interested in “automatic” way, keeping entities more poco).

  3. Is there way to utilize some existing solution? (I hoped nhibernate infrastructure would allow plugging-in custom module to work with mongo behind the scene, but not sure if it allows working with non-sql dbs at all).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:32:56+00:00Added an answer on May 26, 2026 at 2:32 pm

    The DataContext (ObjectContext or DbContext in EF) is nothing else than an implementation of the Unit of Work (UoW)/Repository pattern.

    I suggest you Fowler’s book on Patterns of Enterprise Application Architecture in which he outlines the implementation of several persistency patterns. That might be a help in implementing your own solution.

    1. A DataContext basically needs to fullfil the job of a UoW. It needs to handle the reading and management of objects that are involved in a given lifecycle (i.e. HTTP request), s.t. there are no two objects in memory that represent the same record on the DB. Moreover it needs to provide some change tracking for performing partial updates to the DB (as you already mentioned).

    2. To what regards change tracking, I fully agree that polluting properties with change events etc is bad. One of the recent templates introduced in EF4.1 uses Proxies to handle that and to give the possibility to have plain POCOs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not sure where i've seen this before, but im sure that there
I'm sure there's a clean way to do this, but I'm probably not using
I'm not sure if this question has been asked before but are there any
This works, but I'm not sure why (and I'm fairly sure there's a smarter
I found some tutorials online that could help but I am not sure there
I'm not sure if there is a proper term for what I want to
I am not sure if there is a mistake in my existing code or
I am not sure if there is a way to update edmx file automatically
Using django comments framework http://docs.djangoproject.com/en/dev/ref/contrib/comments/ Not sure is there option, to make all comments
I'm not really sure if there is a single problem here or I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.