n-tier

Should my DAL return DataTables or I...whatever<>?

EDIT 1 I apologize but after reading the 2 suggested articles I still don't understand what I should use. I understand that using IQueryable is not preferred for various reasons but does that eliminate IEnumerable as well? Is a DataTable really my best option? In short, I guess, what is the preferred Return type? I have the followi...

where should datasets reside in a n-tier (multi layered) architecture?

We are currently havin a discussion if dataset should go in the data or business layer? My friend thinks all ADO.NET components should go in data layer. For me this does not seem right for the followin reasons: If you create a fat Data Layer Client, it will be much more difficult to for example migrate everything to a different dat...

Entity Framework - layered design - Where to put connectionstring?

Hi, I am using a layered architecture with the Entity Framework as my datalayer with a bunch of repositories on top which contain the Linq-To-Entities queries. The data layer is one project, next to that I have a Services layer and the interface, which is a website. I want my website to be responsible of specifying the connectionstring...

Have I implemented a n-tier application with MVC correctly?

Being pretty unfamiliar with design patterns and architecture, I'm having trouble explaining to others exactly how my latest application is designed. I've switched between thinking it's a pure n-tier, pure MVC and n-tier with MVC in the presentation layer. Currently I think the latter is correct, but I want thoughts from more experienced...

3-tiers pattern and large amounts of data

Here is my situation: I am trying to follow as hard as I can the 3-tier pattern (i.e. Presentation, Business and Data layer). When I need data from the DB, the Business layer calls the Data layer which returns the information. The Data layer never return a SqlDataReader or DataTable object, but often an enumeration of custom object known...

Circular reference between Assemblies in C# and Visual Studio 2005

I am working hard to standardize one single way of Layered/n-Tiered design of my all applications. I am trying to make all my applications 5 tiered. Code: | UI | | | Business Object | | | OR-Mapper | | | Data Access | | | RDBMS | Suppose I am developi...

Circular reference between Assemblies in C# and Visual Studio 2005 (Again...)

Please first read the following thread: http://stackoverflow.com/questions/924382/circular-reference-between-assemblies-in-c-and-visual-studio-2005 Implementing interfaces is solving my problem but not fulfilling my target. My target is to work only with BO-layer/assembly from the UI layer/Assembly. So that I can maintain a clean la...

BLL errors best practise

What is the best practise for returning an error of a business rule in a BLL? SHould I just raise exceptions and catch them in the presentation layer, shoudl I return some kind of object that holds any exception type info? ...

Does Asp.net MVC help creating n-tier solutions?

My opinion is it does and it doesn't. It does separate logic and data from UI, but it still crams it all together into a single point application. That's why I think it doesn't really, because Controllers are business logic, Views are UI, Models are DAL. These are now just layers within the same app. But are layers supposed to be the...

Manually written business objects or using DAL objects?

Suppose you have three tiers (with namespaces): User interface (App.UI) - calls business layer processes and communicates using objects Business layer (App.Core) - orchestrates processes and uses DAL layer using objects DAL (App.Data) - directly manipulates store and persists objects Let's say that you have User table and thus reflec...

Adding HTML encoding to the business layer

When adding user input to a web page, it should (unless it's HTML of course :) be encoded to help prevent XSS attacks etc.. like this: litForename.Text = HttpUtility.HtmlEncode(MyUser.Forename); I'm putting together a template to generate my business logic layer, and I'm thinking of using it to do all the encoding as soon as the data ...

Subsonic: Tiers of a clown

Hi guys, I've got a nice DAL generated using Subsonic. Is there a way I can generate a skeleton for the BLL? I don't want to plug the SS layer directly into my GUI. I've trudged through both SS forums and it seems that everyone calls the SSS-generated layer a DAL, but they use it as a BLL. Have you used SS and seperated the DAL and B...

Subsonic: Bring me to tiers

Hi guys, This is an embarrassingly basic n-tier question. I've created a DAL project in VS2008 with subsonic. It's got a widget class, a widgetcollection class, and a widgetcontroller class. I've created my Business logic project (no I can't put it in the same tier) that references it. Using certain business criteria, it selects a co...

OO Design vs Database Design

Suppose I am developing an application for a product distributor in C#. The distributor does the following 3 types of transactions: (1) Indent (2) Sell (3) Stock I am designing my classes as follows: public abstract class Transaction { } public class Indent : Transaction { } public class Sell : Transaction { } public class S...

Presentation layer referencing data layer

I have a 3-tier .NET 2.0 app. The presentation layer references the middle tier. The middle tier references the database layer. For some reason, when I compile, the dll's for the data layer appear in the bin of the presentation layer. How do I stop this? ...

Steps to take to slowly integrate unit-testing into a project

I'm currently on a co-op term working on a project nearing completion with one other co-op student. Since this project has been passed down from co-op to co-op, poor practices have been taken along the way and testing has been left until the end. I've decided I'd like to write unit-tests to learn something new while testing. However, ...

How would you go about swapping a connection string to access a test database for unit testing?

I've set up a test database to begin unit-testing an app that I've recently been added to. It is a 3-tier design (presentation layer, BOL and DAL) and this is my first time writing unit tests. I've decided to start at the BOL and I figure the best way is to swap out the ConnectionString (which has been passed along as a Shared String...

Automatically Wrap a Controller Around a Service in ASP.NET MVC

Hi. The question title might not be clear but what I want to do is something like this: This is how I layer out my app App.Domain App.Services App.Web What I want is, if I request something like /api/OrderProcessor/GetAllOrder it will call method GetAllOrder in App.Services.OrderProcessorService. The method will return an IL...

SqlCacheDependency in n-Tier Architekture

I read some articles about SqlCacheDependency. I think it is a really cool way for updating caches, but i'm not sure how i can handle this technologie if my application is a n-tier architekture. Is this just useful if my program is a small webapplication, or is there also a way for use in big n-tier architektures? ...

How should my MVC Model work with my Business logic classes?

So I have a MVC app and in another project I have a normal collection of classes which handle the Business and Data logic for the application. I also have some logic in the Model of the MVC project itself. This logic handles ViewModels and the like, things which could not have been done in the n-tier project as they relate to the MVC pro...