Architecture :: Inherited DTOs, How To Implement The Layers Facade, Bll And Dal?
Feb 18, 2010
I doubt how to implement the layers
FACADE, BLL and DAL, using
DTOs specialized ..
where:
public class ClassA
{
private int _Test1;
public int Test1
{
get { return _Test1; }
set { _Test1 = value; }
}
}
public class ClassAB : ClassA
{
private int _Test2;
public int Test2
{
get { return _Test2; }
set { _Test2 = value; }
}
}
public class ClassAC : ClassA
{
private int _Test3;
public int Test3
{
get { return _Test3; }
set { _Test3 = value; }
}
}
In the database, there is the 3 tables, as described above.how do I implement the facade, bll and dal? only one class for 3 DTOs?
View 3 Replies
Similar Messages:
Sep 20, 2010
I just started working on one of the application, bascially its some maintanence work. I see from the application that Facade pattern has been utilized as I see Class Library projects named as Business Facade, Data Facade.
Though I am not redesigning this, but just wanted to know what this pattern is, a simple explanation, use, real world example should be good enough. The application is basically a banking app. I know its diff but if anyone can give me some hints/points as in why the designer chose this pattern (banking app).
View 5 Replies
Nov 18, 2010
I want to use Linq to SQL in my web projects. I mostly work in small and medium size projects. Please guide me what layers I should use ?
Previously I was using DAAB and was using 4 layers (business objects, business logic layer, data access layer and user interface).
View 5 Replies
Jul 6, 2010
I have three layers like UI, business and data access in my asp.net web application project. If I pass say a company code from the UI to the business to the data access and I query the company details like company name, address, phone etc from the database using sqlhelper executedataset() which wil return me a dataset. Then how do I pass these company details back to the UI layer. Is it correct to just pass the datatable object to the business and UI.
View 6 Replies
Jan 26, 2010
I'm trying to create my first Asp.Net application from scratch. Tried to create this post in some of the other forums but I couldn't find a better place.
So, as the title says, I'm having trouble trying to model my application. I'm like an OOP newbie. I'll show my classes first and then I'll write my questions.
Model Layer
public class User
{
private int id;
public int Id { get { return id; } set { id = value; } }
private string login;
public string Login { get { return login; } set { login = value; } }
private string password;
public string Password { get { return password; } set { password = value; } }
}
Data Access Layer
public class BasicDAL
{
private SqlConnection connection;
//>>Returns a new connection to the database
public SqlConnection GetConnection()
{
//>>If connection is active close it before starting a new one
if (connection != null)
if (connecion.State != ConnectionState.Closed)
connection.Close();
connection = new SqlConnection("MyConnectionStringHere");
return connection;
}
}
public class UserDAL : BasicDAL
{
//>>Insert a new user
public void Insert(User user); { /* Insert into DB */ }
//>>Authenticate user login with its password
public void Authenticate(User user); { /* Authentication code here */ }
}
Business Logic Layer
[Code]....
So, model layer is pretty simple. Just a user representation. On the Data Access Layer I have a basic class with a GetConnection method. All DAL classes will extend this one.
My first problem lies on Business Logic Layer. With the above scenario, I've placed the same methods that I placed at the DAL. BLL methods would call DAL. As simple as that but I believe It is not the best way to do it, is it? How can I improve those classes?
Also, I have to "try..catch" blocks. That's because I can't find good places for it. I mean, if I place a try..catch on GetConnection method, for instance, how my ASPX page would get this error? How my ASPX page can tell the difference between "database offline" and "sql syntax error" when executing "userBll.Insert(newUser);".
My problem is mainly placing the exception handlers. I understand I would probably have to change return type of some methods. I didn't change because I believe that will have something with the exception handlers.
Btw, please assume I can't use TableAdapters and stuff like that. I would like to create all layers by myself.
View 3 Replies
Oct 25, 2010
Just wanted to know if a singleton class could be inherited and derived.
View 2 Replies
Mar 13, 2010
Here is the scenario.
Every project has a Supervisor.
When I select the supervisor for a particular project, I'm using a dropdownlist.Table is like this
ProjectId | SupervisorId | ......
--------------------------------------
1 | 1
In my application, I'm binding a Collection of Supervisor type, which I'm feeling that it is an additional overhead. Becuase I only want his ID. So binding an object collection to the dropdown which seems no worth.
View 5 Replies
May 19, 2010
I am thinking to use entity model as DAL, how should I create the BLL then? What kind of datasourceobject should I use in the asp pages?
I am looking for best practice to use Entity framework 2 in the three layers design. I had experience at dataset with three layers design.
Should I use objectdatasource at the pages for gridviews? My guess is that entitydatasource by passed the BLL which is not good, so the only option left is the objectdatasource.
Could and should my BL object inherit those entity model in the DAL, so I dont need to recreate their object's property?
View 4 Replies
Dec 23, 2010
I have a quick question in regards to testing my validation. I have been looking through a few MVC examples and have noticed the 'Validating with a Service Layer' tutorial which is pretty nice. It discusses how to abstract your code out etc..My question is, that they have validation occuring in the service layer, if errors occur, the error + message then gets added to a model state dictionary.Now i want to test my model to make sure my business rules are being applied to it, but with this approach, for starters, the Validation method is not in the interface. Now, if the validation method was in the interface, during testing you would have to re-implement the validation on the testing side.Am i missing somthing? Where should your validation code go? I feel like it should go in the model, but then i have to track the errors on the model side.
View 1 Replies
Jun 24, 2010
It's appreciated if you could share your thought.I have seen a e-commerce website design which have a few layers:Common,DataAccess,BusinessLogic,Operational.In the Common layer,it includes all the classes with only attributes and properties,no methods nor data access codes here.
In the DataAccess layer,there is a class for each action per class in the Common layer.For example,
a class for the Select action of class A of Common layer,
a class for the update action of class A of common layer,
a class for the Select action of class�B of Common layer,
etc...
Is this a design I could use for a potential high trafic website?What's the pro and con of this design.
View 3 Replies
Feb 19, 2011
some link of some articles for learning N-tier architecture ....
View 5 Replies
Jul 12, 2012
I would like to implement 3 tier arch in my project. What is the best and optimized 3 tier architecture in asp.net..
View 1 Replies
Apr 26, 2010
I am trying to implement a plugable architecture within my MVC application. The modules are based on the following post [URL].
When I drop the DLL into the bin folder manually, everything works perfectly.
What I'm trying to do is, upload the DLL via a webform and copy the stream to the bin folder. But when I try view the page I get the following error - The module was expected to contain an assembly manifest.
System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFile(assemblyName);
View 5 Replies
May 7, 2015
I want to use 3 -tier archhitecture in my registration form how to do that in a simple way....
View 1 Replies
Oct 5, 2010
how to implement web services in a 3 tier architecture and also give a brief idea about how to implement coding as soon as possible.
View 1 Replies
Feb 7, 2011
Are there any tools out there which I can use to implement the Entity Translation Pattern? I dont want to write all the mappings by hand.
View 2 Replies
Jan 12, 2011
what is considered a many-to-many relationship in a domain model class ? I mean how to implement a many-to-many relationship in a domain model class ? In SQL this is represented by a link table between two table but how this is represented in a domain model driven application ?
View 1 Replies
Jan 13, 2011
I'm considering going at this myself because my requirements are particular and highly customized:The grid is bound to a collection of complicated objects, each of which may contain child and grandchild objects. Depending on data and context, the template'd cells vary from TextBoxes to ComboBoxes to Calendars to a combination of controlsTextBox cells have Google-style auto-complete functionality. Also each TextBox cell can expand into a small TreeView pane that allows hierarchy-navigating selection of a value should auto-complete be insufficient
View 3 Replies
Nov 9, 2012
Any good example of Three tier architecture in entity framework 4.0 ...
View 1 Replies
Feb 16, 2011
I have an MVC2 application with the following classes:
-OrderModel
-LineOrderModel
-OrderController
-LineOrderController
In the OrderController class I'm recollecting some values of a web form . Until now, I created instances of each order line (LineOrderModel class) and OrderClass inside of the Controller.
I was trying to create a OrderFacade class in order to encapsulate the different things to do when creating an order.
So in that class I created a method like this:
public void saveOrder(int idProvider,decimal? price)
{
// Here I create instances of OrderModel and LineOrderModel
// and assign their properties
}
but my problem is I don't know how to pass all the order lines captured from the web form.
I think it doesn't make sense to create and pass to that method a List with orderLines class (because the point of this is to operate with the Facade, not with the class directly)
How could I encapsulate the different lines (all with properties like numberUnits,idProduct ...) into a List of generic objects, each one with these properties?
Maybe something like a List<List<object>> ?
View 1 Replies
Jul 22, 2010
I need to implement field level security based on the roles. I have a page Employee.aspx . In that i have ten controls. If i am enter as admin role i need to show all the controls. If i am enter as user have to show only five controls. How to design the appplication for control level security?
View 5 Replies
Mar 13, 2011
I have some problem about observer pattern. My example is webboard system.
My solution wanna be refresh page after another user submit discussion.
I try to use observer but i don't know how to refresh another user's web page.
View 1 Replies
Jan 28, 2010
I have a facade class that my controller class calls out to and in that facade class, for whatever reason, I'm building a string a href element. And it resolves fine in casini but when it gets out in the real world like localhost it doesn't work. Is there a way to do this?
string goBackLinkForErrorMessage = "<br /><a href='/MyController/Action?id=" + blah + "'>Go Back</a>";
View 1 Replies
Jun 18, 2010
Our solutions requires validating users against a custom database. This also includes roles which dictates what he user can do in the system. What is the best way to implement implement security, is it to use Windows Identity Foundation or the default Membership Provider and Role Provider that comes with .net?
View 2 Replies
Mar 27, 2010
which one is better in "Session Facade Class" and "Singleton Object" design patterns in ASP.Net? Also, please state the scenarions where specific design pattern is advisable to use.
View 1 Replies