Architecture :: How The Data Pass From One Layer To Another Layer In Mvc Design Pattern

Apr 1, 2010

how the data pass from one layer to another layer in mvc design pattern...

View 2 Replies


Similar Messages:

Architecture :: How To Pass The Values From Presentation Layer To Business Logic Layer

Oct 26, 2010

I am new to this .NET what is the difference between N-Tier and 3- Tier Architecture. If they are same. How to pass the values from presentation layer to business logic layer.

For Example

I have 10 controls in presentation layer. I passing values to these controls. How the architecture works.

View 3 Replies

Architecture :: How To Pass The Data Between Data Access Layer And Business Acces Layer

Jun 3, 2010

here i have in 3-tier architecture , how to pass the data between DAL and BAL. i am using grid view to edit the data,when ever i click on the edit button all the corresponding fields should come to textboxes. i tried for delete ,it works fine bt not working to EDIT.

View 7 Replies

Architecture :: Data Access Layer And Business Logic Layer?

Jun 24, 2010

I am building a web site following the tutorials on asp.net. I am using dataset as data access lay, and writing classes to access the dataset. But the example is just basic ideas, how do I retrieve individual table column value in the business layer?For example, if I have a table called Product, I only want to find out what is the product name by product id. I did this in my ProductBLL:

public ProductBLL
{
public int GetProductName(string productId)
{
ProductDataSet.ProductDataTable prodData = Adapter.GetProductById(productId);
[code]...

Is there a better way, or am I doing this correctly? Can anybody give me a reference to a more complicated business logic model?

View 16 Replies

C# - N-layer Business/service Layer Design?

Jan 26, 2011

I'm trying to reevaluate our n-layer architecture and would love to get some based on your experiences. Here is our typical .NET n-layer (sometimes n-tier) design.

Project.UI
Project.Services
Project.Business
Project.Model
Project.DataAccess

DataAccess typically consists of Entity Framework 4 and Repository classes. I attempt to follow the Aggregate Root concept in order to avoid having a repository for table, easier said than done in my experience. I tend to have ~70% match between Repositories and Tables.

Model usually consists of my Entity Framework 4 entities, I've been using Self-Tracking EF entities with success.

Business is what I struggle with the most. I typically have a Manager class for every Repository. This class will contain methods like .Add() which will perform business validation before forwarding down to repository.Add().

Services, typically I will only implement this if in fact I am looking to create a web service based solution. This layer will be tasked with marshaling requests/responses between DTOs and entities. And most importantly provide the more coarse grained interface. For example a TradingService.SubmitTrade(), which is really a facade for a business transaction which might include AccountManager.ValidateCash(), OrderManager.SubmitOrder(), etc.

My business layer is very entity centric, really it's just the glue between the entities and the repository, with validation in between. I've seen many designs where the Service Layer is what holds a reference to the repositories (in essence skipping the "business layer"). In essence it serves the same purpose as my Business layer, it does the validation, however its' responsibility (and naming) is a higher level, more coarse grained business transaction. Using the example above the TradingService.submitTrade() will not delegate to any business manager classes, it would itself query the necessary repositories, perform all the validation etc.

I like my design in a sense that I can reuse a business layer method in multiple service calls, however I hate the fact that for every repository I have a matching business layer manager, creating tons of extra work. Maybe the solution is a different type of grouping at the Business Layer level? For example combine individual Manager classes like PhoneManager and EmailManager (note I have Phone entities and Email entities) into a logical Manager class such as ContactsManager (note I don't have a "Contact" entity type). With methods such as ContactManager.GetPhones() and ContactManager.GetEmail(), etc.

View 1 Replies

Use MVP Pattern And Add A Presenter Layer In Web App?

May 12, 2010

I would like to use MVP pattern and add a presenter layer in my web app. EX;- for filling the data in page I am doing like this.

[Code]....

If I add a presenter class, Do I need to move this code in presenter layer?

View 2 Replies

WCF / ASMX :: Design A Web Service Layer On Top Of Db For Data Integration?

Dec 22, 2010

We're doing a data integration project between a MS Sql Server database and a Microsoft CRM system (through its web services).

We're trying to build a "service" layer on top of the database. The design of our current solution is to use web services for CRUD, with xml being the format of data.

Views are created to consolidate related tables into one entity, and we query these views, using the "SELECT * FROM someview " + "For XML" to generated xml that will be returned from our web services.

For update we're trying to use the same approach - using SQL XML to map updates views, we have "instead of" triggers defined on top of these views, and in these "instead of" triggers we update the underlying tables.

The views/triggers are generated by tools so don't be too concerned with coding efficiency here...

what do you think if we use WCF data Provider to publish a enterprise data model (essentially DTOs) ? p.s., we don't have a BL layer for now, it's all in the stored procedures!!!

What's your opinion on this / any better design?

View 4 Replies

Architecture :: Use STATIC Methods In Data Access Layer?

Feb 4, 2011

I am developing a web application, which has Data Access Layer and this layer has only one class, in which all methods are static methods like static Insert, static Update, static Search. It has no properties. I am using these methods in my Bussiness Logic class for my users who are visiting my website.Now my question is : 1. Is it right to use static methods in this scenario ?2. What will happen if 10 users call Insert method at the same time ?

View 3 Replies

MVC :: How To Make Business Layer Seperate From Presentation Layer

Feb 23, 2011

I've even got my JQuery Ajax submission going on now but I've encountered another problem. I *think* it's something to do with the structure I'm using but like I say, I'm fairly newo this.I have my AJAX form submission which builds my "PersonViewModel" (model for the presentation layer) in JSON and sends it to "@Url.Action("RegisterSubmit")" in my Person Controller. Now, I seperate my business layer from my View/presentation layer so in "RegisterSubmit"I'm verifying the model is valid then instantiating a new instance of my business model "Person", adding the values from "PersonViewModel" and then calling my "Save" function.

View 7 Replies

Business Layer Errors And Service Layer Handling?

Mar 7, 2011

We're building a large web app that has numerous layers. In order to communicate to the business layer we're using a service layer that the web layer calls when data is needed. Unfortunately, it seems that if exceptions are thrown in the business layer, it seems that the services on the web side are wrapping the exceptions and re-throwing them. We're looking for a clear way to encapsulate the error and log it, without WCF wrapping a new exception around the original.

View 2 Replies

MVC :: Custom Ex Class Be In The Repository Layer Or The Domain Layer?

May 6, 2010

My repositories throw exceptions (System.Exception) when some things go bad and I know this is bad practice.. so i will create a custom exception (DataException). My question is should this custom ex class be in the repository layer or the domain layer? Im thinking it should be in Domain layer where all business objects and repository interfaces live but just want to make sure.

View 3 Replies

Architecture :: Exception Handling Between Data Access Layer And Code Behind?

Jul 20, 2010

If an error happens in the DA_layer, how do I pass it do the code_bedhing to show the user?

[Code]....

View 3 Replies

Architecture :: Should The Unit Of Work Point To The Service Layer Or The Repository And Then The Repository Point To The Service Layer

Jan 26, 2011

Just wondering, in an ASP.NET MVC3 environnement with entity framework. Should the Unit of Work point to the service layer or the repository (and then the repository point to the service layer) ?

Ive saw two example:

* One where the unit of work and repository both have an instance to the service layer..

Link: Entity Framework 4 CTP 4 / CTP 5 Generic Repository Pattern and Unit Testable

Doesn't use a service layer but its obvious that one could be use in that case.

* Second where the unit of work have an instance to the repository which have an instance to the service layer..

[URL]

What would be better ?

View 11 Replies

Architecture :: Exception Layer In N-tier Architecture?

May 13, 2010

I'm developing a n-tier architecture... I'm confused with handling exception in the layers... Is it a good practise to add a Exception Layer to the architecture.

View 3 Replies

Architecture :: Using Data Sources Vs. Using Data Access Layer To Populate Presentation Controls?

Mar 17, 2010

We are using a tierd design with a Data Access Layer and classes for everything we need. This serves as an advantage because we do not have to write querys over and we can separate the Presentation layer from the Data Access Layer and Business Rules.I have always in the past populated GridViews, DataLists, repeaters,etc with SqlDataSources. This is what I have become accustomed to and I feel like it is simple. For querys such as Select * from Members, I feel like using a DataSource is simpler than having to go in the code and calling methods to populate and DataBind these presentation controls.


I am working with a gentleman who has introduced me to the world of Data Access Layers and we are breaking everything down into simeple, but effective queries to populate controls and do what we need to accomplish with this application. He is not very approving of using any type of DataSource. We are disagreeing on the time and place to use these class methods to call the database.So my question is, which is more widely used in the programming world? Do most people use DataSources to populate presentation controls regardless of the Data Access Layer they are working with? Which type of queries are best suited for a DAL - simple, populating queries or complicated joins and upserts?

View 9 Replies

Architecture :: Differences Between MVC And 3-Layer?

May 11, 2010

In my opinion, these architectures have some differences, such as:

1. 3-layer is a linear architecture, but MVC is a triangle architecture.

2. Presentation Layer of 3-layer includes View and Controller of MVC? And Model of MVC includes Business Layer and Data Access Layer of 3-layer

I think 2 differences above are not obvious or are incorrect!

View 3 Replies

How To Pass FormsAuthentication.SetAuthCookie From Data Access Layer Class To WebService To JavaScript

Jan 29, 2010

I am using DotNetOpenAuth in my ASP.Net Website. I have modified it to work with Facebook Connect as well, using the same methods and database structures. Now I have come across a problem.

I have added a Facebook Connect button to a login page. From that HTML button, I have to somehow pull information from the Facebook Connect connection and pass it into a method to authenticate the user. The way I am currently doing this is by:

Calling a Javascript Function on the onlogin function of the FBML/HTML Facebook Connect button. The javascript function calls a Web service to login, which it does correctly. The web service calls my data access layer to login. And here is the problem: FormsAuthentication.SetAuthCookie is set at the data access layer. The Cookie is beyond the scope of the user's page and therefore is not set in the browser. This means that the user is authenticated, but the user's browser is never notified. So, I need to figure out if this is a bad way of doing what I need or if there is a better way to accomplish what I need. I am just not sure and have been trying to find answers for hours.

View 1 Replies

C# - Proper Implementation Of N-layer Architecture?

Feb 28, 2011

I have been learning C# for the last year or so and trying to incorporate best practices along the way. Between StackOverflow and other web resources, I thought I was on the right track to properly separating my concerns, but now I am having some doubts and want to make sure I am going down the right path before I convert my entire website over to this new architecture.

The current website is old ASP VBscript and has a existing database that is pretty ugly (no foreign keys and such) so at least for the first version in .NET I do not want to use and have to learn any ORM tools at this time.

I have the following items that are in separate namespaces and setup so that the UI layer can only see the DTOs and Business layers, and the Data layer can only be seen from the Business layer. Here is a simple example:

[Code]....

Am I completely off base? Should I also have the same properties in my BLL and not pass back DTOs to my UI? what is wrong and what is right. Keep in mind I am not a expert yet.

I would like to implement interfaces to my architecture, but I am still learning how to do that.

View 4 Replies

How To Use Of Business Layer In 3-tier Architecture

Jan 27, 2011

I am implementing 3-tier architecture. I just wanted to know the role of business layer in 3-tier architecture.

I am developing application in using entity framework. So I have entity object which is accessiable in PL,BL & DL. My question is whether input assignment to entity object should be in PL OR BL.(Consider there is save method)

View 2 Replies

Architecture :: Performance Between 3 Or 2 Layer With Linq

Mar 13, 2011

i build online course selection for a university now i want to make it layering and i dont know to make it 2 layer or 3 layer i mean mix business layer and database layer because i use linq so it is not require to check request data that in sql from client in business layer because linq check it autimatically to preent injection and etc.is it right?can i put my class and DB class in same place or layer?if i make it 2 layer the performance becom better?

View 5 Replies

Difference Between Three Tier And Three Layer Architecture?

Feb 12, 2011

whats is the difference three tier and three layer architecture. I need three tier architecture which is fulfill the object oriented requirement. and database change flexibility.

View 4 Replies

Architecture :: Set Images In Business Layer?

Dec 17, 2010

I am creating an ASP.NET MVC application and want to display an icon in the view based on a value of a property in the model. I guess I want to have the logic deciding which image to show in the business layer (which is in a separate class library project) but the actual images files in the web application's "Content" folder. Should I set the url of the image in the business layer? I don't want the business layer to know that is serves a web application, it can be a Windows Form or WPF application as well. If I set the url with System.Web.HttpContext.Current.Server.MapPath it feels like I am getting an unwanted dependency on System.Web, right? What are the options here?

View 1 Replies

Passing XML Document Among 3-tier Architecture Layer?

Oct 31, 2010

I am making use of 3-tier architecture.In UI layer, i am getting user input and converting it into XML document. But now question arises that how can i pass this xml document to business and data access layer?

View 2 Replies

Architecture :: Passing Entities To Business Layer?

Mar 30, 2011

I am working on implementing a web application in ASP.Net by following the MVC design pattern (Not ASP.Net MVC). As part of the design, we have entity objects that has only properties as per the corresponding table structure and the idea is using these entity objects in the view layer and the same entity objects are passed to Persistence Layer for saving the data to the database. Business Objects in the business layer are responsible for interacting with the database.

As view creates the entity objects and passes to next layer, what would be the best practice to pass the entity objects to the business layer? Should the business objects accept data objects as parameters and interact with the persistence layer? Is there any other best practice to pass the required objects from the view layer to the next layer? As business objects also need to access the properties of the entity objects passed from the view layer, do we need any "translation" from entity objects to business objects?

the best practices to pass entity objects from view layer to the next layer and also how the entity objects created by the persistence layer can be used by business objects?

View 6 Replies

Architecture - A Modern N-layer Web Application Sample?

Jul 18, 2010

So my asp.net is very very rusty, and i'm trying to get back into best practices and what not. So, I whip out google and start looking for examples and samples and tutorials, but what do I find? Old crusty stuff that tends to be written even before "the latest" technology was released back in the stone age.Sure, the concepts may still hold up. But the actual implementations are basically useless. I'm looking for something using Linq, n-layers (not tiers. Tiers can be a layer, but a layer is not necessarily a tier) some kind of current ORM (L2S, EF, etc..) and some real-world stuff, not abitrary and useless examples.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved