Why put a DAO layer over a persistence layer (like JDO or Hibernate)

You make some points. But I nevertheless use a Dao layer, here’s why: Database accesses are calls to a remote system. In all such cases (also web-service, ajax etc…), the granularity of interaction need to be big enough. Many tiny calls would kill performance. This performance necessity requires often a different view of the system, … Read more

Mocking vs. Test DB?

I think you’ll probably want to do some integration testing to check logic that is enforced by your database structure, for example constraints, triggers, autoincrement columns, etc. You should, however, for unit testing mock out whatever framework components that your DAL relies upon as you want (in your unit tests) to test only those components … Read more

Why does an Entity Framework Connection require a metadata property?

Expanding on Randolpho’s answer: The metadata property specifically points to the location of the .SSDL (Storage Model,) .CSDL (Conceptual Model,) and .MSL (Mapping Model) files. These three files essentially are the Entity Data Model. The “res://” URI-style qualifier indicates that the files are embedded as resources in the compiled EDM assembly.

Nullable values in C++

Boost.Optional probably does what you need. boost::none takes the place of your CNullValue::Null(). Since it’s a value rather than a member function call, you can do using boost::none; if you like, for brevity. It has a conversion to bool instead of IsNull, and operator* instead of GetValue, so you’d do: void writeToDB(boost::optional<int> optional_int) { if … Read more

Should I return IEnumerable or IQueryable from my DAL?

It depends on what behavior you want. Returning an IList<T> tells the caller that they’ve received all of the data they’ve requested Returning an IEnumerable<T> tells the caller that they’ll need to iterate over the result and it might be lazily loaded. Returning an IQueryable<T> tells the caller that the result is backed by a … Read more

Transaction script is Antipattern?

Transaction Script is definitely not an anti-pattern. From what I find about Transaction script, it is not object-oriented at all. You are right, it is not, indeed. That fact however doesn’t make it an anti-pattern. Although it is a procedural approach, indeed, it still has its right place in the series of business logic architecture … Read more

What is the difference between Database Abstraction Layer & Data Access Layer?

Data Access Layer= Create, Read, Update, Delete (CRUD) operations specific to your application domain Data Abstraction Layer= performs generic database operations like connections, commands, parameters insulating you from vendor specific data libraries and providing one high level api for accessing data regardless of whether you use MySQL, Microsoft SQL Server, Oracle, DB2, etc…

Object persistence terminology: ‘repository’ vs. ‘store’ vs. ‘context’ vs. ‘retriever’ vs. (…)

As noone has yet answered the question, I’ll post on what I have decided in the meantime. Just for the record, I have pretty much decided on calling most data store classes repositories. First, it appears to be the most neutral, non-technical term from the list I suggested, and it seems to be well in … Read more

techhipbettruvabetnorabahisbahis forumueduedusedueduedueduedueduseduedus