data-access-layer

What to return from the DAL to BLL

帅比萌擦擦* 提交于 2019-12-03 06:15:26
问题 I currently have an application which consists of: User Interface (web page) BLL (Manager & Domain Objects) DAL (DataAccess class for each of my Domain Objects). I use the following in the UI to search for a domain object. protect sub Button1_Click() { IBook book = BookManager.GetBook(txtID.Text); } Here is my BLL public class BookManager { public static IBook GetBook(string bookId) { return BookDB.GetBook(bookId); } } public class Book : IBook { private int? _id private string _name; private

Communication between BLL and DAL

核能气质少年 提交于 2019-12-03 04:18:36
Solution setup: DAL (class library) BLL (class library) Common (class library (some common functionality - enums, logging, exceptions,...)) Application1 (Windows Application) Application2 (Windows Application) WebApp (Web application) ... Let's say I have a Customer entity, which is: a table in SQL server a CustomerDataTable in DAL a Customer class in BLL a BLL.Customer class in all the applications What kind of objects should BLL and DAL use for communication - DataTable or List<Customer> (for example)? In first case, BLL logic should transform Customer object to DataTable and send it to DAL.

Where do you put SQL Statements in your c# projects?

若如初见. 提交于 2019-12-03 04:14:59
问题 I will likely be responsible for porting a vb6 application to c#. This application is a windows app that interacts with an access db. The data access is encapsulated in basic business objects. One class for one table basically. The existing vb6 business objects read and write to the DB via DAO. I have written DALs and ORMs a few times before but they all targeted SQL Server only. This one will need to target access and sql server. In previous projects, I would place the SQL strings in the

Simple Data Access Layer

岁酱吖の 提交于 2019-12-03 03:57:09
Can anyone suggest a simple Data Access Layer (C# .NET)? Not keen on using the Microsoft Application Data Access block, seems very bloated and overkill. Also don't want to use LINQ to SQL for various reasons. I want to build upon this and create our own in-house ORM, again for various reasons. In the past I've always had the Data Access Layer already built so was never involved in building.... Here is a complete list: ORM tools ".Net" ADO.NET Entity Framework, Microsoft’s ORM (released with .NET 3.5 SP1) Base One Foundation Component Library, free or commercial BCSEi ORM Code Generator, free

POCO's, DTO's, DLL's and Anaemic Domain Models

狂风中的少年 提交于 2019-12-03 03:23:30
问题 I was looking at the differences between POCO and DTO (It appears that POCO's are dto's with behaviour (methods?))and came across this article by Martin Fowler on the anaemic domain model. Through lack of understanding, I think I have created one of these anaemic domain models. In one of my applications I have my business domain entities defined in a 'dto' dll. They have a lot of properties with getter's and setter's and not much else. My business logic code (populate, calculate) is in

What is the difference between DAL, DTO and DAO in a 3 tier architecture style including with MVC

巧了我就是萌 提交于 2019-12-03 03:05:30
Recently I was learning about ORM (Object Relational Mapping) and the 3 tier architecture style (presentation,business and data persistence ). If I understand correctly, I can separate the data persistence layer into DTO and DAO layer. I would like to understand, how the following parts works together in a data persistence layer. DAL (Data Access Layer) DTO (Data Transfer Object) DAO (Data Access Object) In a top of that I learnt that In larger applications MVC is the presentation tier only of an N-tier architecture. I got really confused, how it can be even possible for example in a 3 tier

Data access architectures with Raven DB

佐手、 提交于 2019-12-03 02:25:23
What data access architectures are available that I can use with Raven DB? Basically, I want to separate persistence via interfaces, so I don't expose underline storage to the upper layers. I.e. I don't want my domain to see IDocumentStore or IDocumentSession which are from Raven DB. I have implemented the generic repository pattern and that seems to work. However, I am not sure that is actually the correct approach. Maybe I shall go towards command-query segregation or something else? What are your thoughts? Personally, I'm not really experienced with the Command Pattern. I saw that it was

Design Patterns for Data Access Layer

偶尔善良 提交于 2019-12-03 01:45:24
问题 I have an application which uses a database (MongoDB) to store information. In the past I have used a class full of static methods to save and retrieve data but I have since realised this is not very object-oriented-ish or future proof. Even though it is very unlikely I will change database I would rather something that does not tie me too strongly to Mongo. I would also like to be able to cache results with the option to refresh the cached object from the database but this is not essential

Where is the line between DAL and ORM?

家住魔仙堡 提交于 2019-12-03 00:40:34
问题 The terms are often thrown around interchangeably, and there's clearly considerable overlap, but just as often it seems implied that people see something strongly implied by saying that a system is an ORM that isn't implied by it being a DAL. What is that? What, if any, are the key points that differentiate these types of system? For example, let's say I have some code that implements Database, Table, Column and Row classes, populating them by automatic analysis of an existing database,

What are the disadvantages of Typed DataSets

折月煮酒 提交于 2019-12-02 21:50:09
I come from a world that favors building your own rather than rely on libraries and frameworks built by others. After escaping this world I have found the joy, and ease, of using such tools as Typed DataSets within Visual Studio. So besides the loss of flexibility what else do you lose? Are there performance factors (disregarding the procs vs dynamic sql debate)? Limitations? Typed datasets are by far an upgrade from the world of classic ADO disconnected recordsets. I have found that they are still nice to use in simple situations where you need to perform some sort task that's row oriented --