C# - To Structure My BL And DAL In Conjunction With NHibernate

Oct 20, 2010

Typically I would have ran with the traditional 3-Tier approach but after spending some time looking around at various options I've got an inkling that some kind of ORM might be a better fit and I'm considering nHibernate.However,I'm looking for some guidance on implementing nHibernate and more specifically how I would structure my BL and DAL in conjunction with nHibernate.With nHibernate I would create my Objects (or DTOs?) and use nHibernate methods for my CRUD interactions all in my DAL.But what I can't get my head around is the Objects defined in the DAL would be probably be better situated within the BL, i.e. where validation and other stuff can be performed easily, and I just use the DAL from the various ObjectFactory's / ObjectRepositories. Unfortunately it seems through the many articles I've read this isn't mentioned or skirted over and I'm a tad confused.What is the more accepted or easier method of implementation when using nHibernate in a 3 Tier system?Alternatively, what is the conventional method of exposing objects through the business layer from the data layer to the presentation?

View 5 Replies


Similar Messages:

AJAX :: Can Use Response.write In Conjunction With An UpdatePanel

Feb 11, 2010

I want to bring up an Alert messagebox if a user does not fill in a field on my webform before clicking a submit button on the form. I also want to use an UpdatePanel because it makes it a smoother user experience. But I am experiencing a conflict with

response.write("<script>alert('fill in Comment before submitting');</script>");

and the UpdatePanel. If I remove the Updatepanel then I can use my Alert message above but it loses the page temporarily until the user clicks "OK" on the messagebox. My alternative - using the UpdatePanel - was to add a label to the webform where if a user does not fill in the requested info - a label would display text giving the same message - very smoothly with the UpdatePanel. But the label is not modal like the Alert message.

Is there a way I can use response.write in conjunction with an UpdatePanel? The webform is fairly basic. It has a couple of asp.net textboxes and labels and an asp.net button control. I guess I could use a "required" label, but I like the modal property of the Alert message better.

View 4 Replies

Forms Data Controls :: Should Caching Be Used In Conjunction With Custom Paging

Feb 8, 2010

I'm doing a tutorial on custom paging. It makes sense to use this for a high volume site. I haven't worked with caching yet but that also seems very useful for a high volume site. Are these two things typically used in conjunction with each other?

Can someone offer some guidance on when to use or not to use these together?

View 1 Replies

Jquery Validation Plugins In Conjunction With Server Side Fallbacks?

Jan 20, 2010

I like the look of some of the Jquery validation plugins as opposed to the ASP.NET validation controls.

However, one big benefit of the ASP.NET validators is they automatically work on the server side too. Hence saving time and saving validation getting missed when work is maintained.

I am wondering if anyone has come across any tool/plugin to assist in automated mapping of jquery client side validation to a server side fallback.

View 2 Replies

MVC :: Limitations Of URL Structure In 2

Jun 16, 2010

We are currently building a site in ASP.net MVC 2 and we have discovered that the URL's we have specified are not supported by MVC. This is what our developers are telling us anyway. I'd like to get feedback form this forum. My asp.net MVC knowledge is limited (I am an old school ASP 3 guy who hasn't programmed for years) but am trying to learn as much as I can so I can understand the limitations. say for example the app is a jobsearch site in the healthcare sector e.g. we would like the urls to be the following:

1. (non advanced searech) [URL]

2. (advanced search) [URL]

they are telling us that they need to send all parameters in the url even if they are blank so our example 1 here would not be possible. It would need to contain all of the possible advanced parameters in the search like this: [URL] most seaerches are basic i.e. looking for job in a location. but users have the optyion to do an advanced search also. The dev is telling us that we must send all params empty in the URL even in a basic search. Has anyone come across this limitation beforee and if so how did you combat it?

View 2 Replies

C# - How To Implement Rank Structure

Jun 15, 2010

What is the best way to implement a rank system:

here is the code i will use

[code]....

View 2 Replies

How To Structure A Website Using Membership

Oct 27, 2010

i have to build a ASPNET website on which some functionalities will be available to logged in users.I'm trying to understand the right thing to to in building my pages.

I've found the following code in Page_PreInit:
protected void Page_PreInit(object sender, EventArgs e)
{
if (Membership.GetUser() == null) //check the user.. Weather user is logged in or not
{
this.Page.MasterPageFile = "~/General.master";
}
if (Membership.GetUser() == "ADMIN") //check the ADMIN.. Weather ADMIN is logged in or not
{
this.Page.MasterPageFile = "~/ADMIN.master";
}
else
{
this.Page.MasterPageFile = "~/Member.master";
}
}

..but i don't' know if this is the right approach in designing an app.Is it right to switch at runtime Master page according to username/role?

View 1 Replies

How To Create A Forum Like Structure In ASP C#

Jun 29, 2010

i want to create a forum like page in ASP ,C# where user can enter some question.
Administrator reply this question,according to if user does not satisfied with the solution then in same thread he may ask for further clearance.for example the forum of asp.net ( the current page)

View 5 Replies

DataSource Controls :: How To Structure A CTE

Jan 9, 2010

I have inherited a piece of code that is a bit of a pig. It uses a cursor to loop through a list of stores and count customers. I would like to change this to use a CTE, but am not sure how to configure it.The basic functionality of the SP is:Declare variablesSet up start and end datesDeclare CursorGet a list of stores to checkOpen the CursorWhile... Loops through the stores Insert a new record into the Destination Table Count up the new customers for this store Count up the returning customers to the store Update the new record with the totalsLoopThe code:

[Code]....

View 4 Replies

Embedding Whole Directory Structure?

Dec 13, 2010

I have a large directory structure with JavaScript, images, etc. that depend on each other. I would like to encapsulate it all into a DLL so I only have to reference one thing and not have multiple copies of all these files across projects.

Because the files depend on each other, I'm thinking I can create an IHttpModule that registers a route to accept URLs such as /MyEmbeddedDir/subdir/file.js. Anything in MyEmbeddedDir would then be handled by a custom IHttpHandler that does the correct mapping. Each web application would then need to reference the DLL and add the module and handler to web.config. Does this seem reasonable?Also, is there an easier way to embed/reference the files than to set the build action to embedded resource and add [assembly: WebResource(...)] to each file (there are dozens!)?Edit: If I'm not using WebResource.axd then I shouldn't need to add [assembly: WebResource(...)]

View 2 Replies

Go From A Datatable To Hierarchical Structure?

Feb 22, 2011

I have a datatable which i get from the databasemanager class, and i would need to transform that data into a hierarchical structure

either binding it directly to a .net treeview control or in memory first .

i have an ID column, and a ParentID column.what i do not know necessarily is the parent ID to start with. so first thing to do would be to find out which node is the parent ID.

what would be best practice to loop over this table and make it hierarchical

BranchId ParentId ProductCount HasBranchChildren Name
0 NULL 48 1 Categories
1 0 20 1 CategoryA
2 1 10 1 CategoryA1
3 1 8 0 CategoryA2
4 1 2 0 CategoryA3
5 2 4 0 CategoryA1.1
6 2 6 0 CategoryA1.2
7 0 28 1 CategoryB
8 7 20 0 CategoryB1
9 7 8 0 CategoryB2

this would be an example datatable of course it will have hundreds of items, and it does not always start at the root node, its possible that with a request a certain subset of categories is requested, however i've talked with the database team and they will give me NULL on root nodes in the above example that would be element 0 in the table ....

View 2 Replies

ADO.NET :: Structure The BLL Using LINQ To Entities?

Nov 10, 2010

I am trying to learn LINQ to entities, and am working out how to best structure my BLL layer. I have generated the entity model and have created a generic repository in my DAL that returns results as IList<T>. I initially created the BLL to also return

results as IList<T>:

public IList<DAL.Customer> SelectAll()
{ [code]...

Now I am working on the aspx page, and I can create an ObjectDataSource and configure it to use my BLL, but since I am returning IList, I can't sort since I am not using a DataView. I have seen some articles on the web for converting IList to DataView, but that seems like a lot of overhead for every query.My goal is to keep a clean separation between layers without making things overly complicated. I would like to know how others have done this, or maybe a link to a good tutorial that shows how to structure all three layers.

View 8 Replies

MVC :: Use The Structure Map Configuration For The Tests?

Sep 12, 2010

On a MVC 3 Preview Web Application I am using the following:

1 - Structure Map for IOC

2 - Fluent Validation for Validation

3 - AutoMapper for mapping.

Everything is working fine.Now I created a Test Project. How can I use the same Structure Map configuration for the tests?

View 5 Replies

.net - LabView Control (.ctl) To VB.NET Structure?

Mar 25, 2010

I created a control in LabView. My LabView code writes data of that type to a binary file. I want to read this data into a VB Structure.Can I do this programmatically, or do I need to manually create a corresponding structure?

View 1 Replies

Difference Between Structure And Class?

May 3, 2010

it seems classes and structure are same. what is the basic difference between Class and Structure?

View 10 Replies

How To Use NHibernate With 3.5

Aug 27, 2010

I want to use NHibernate with Asp.net 3.5 but i don't know how to use it.I search on Google but couldn't find the complete explanation about why to use NHibernate,Advantages of using it and integration with Asp.net projects.

View 4 Replies

How To Create A Simple Xml Structure Using The XMLWriter

Feb 21, 2010

I'm trying to create a simple xml structure using the XMLWriter in visual basic for the purpose of creating an html page based on user input.

Here's an example of what I've got so far:

[URL]

View 3 Replies

Web Development - Website Structure / Flow?

Feb 17, 2011

ASP.NET, web form model.Is there any sample code/site that demonstrate a couple samples for regular website patterns/ templates? Like if I want to use tab to switch between different pages, should I put the code in a single page or in different page, and treat each tab as a page.Or if in a search page (just a single search bar and button), should I display my result panel in same page using dynamically enable the result panel, or just to another page? I want to find a general design pattern/ template.

View 2 Replies

Return Tabular Structure From Web Service?

Jan 5, 2010

Whats the best way to return a tabular structure from an ASP.NET (2.0) web service?

It should be inter-operable with Java, Iphone App or any other platform.

EDIT: By inter-operable I mean the other technology/client should be able to consume it or deserialize it to their native types, instead of parsing response XML.

View 5 Replies

How To Structure MVC 2 Project With Areas Sensibly

Aug 24, 2010

I want to structure my ASP.NET MVC 2 web application sensibly using Areas. The application consists of the two main parts Website which is the default part and Dashboard which administrates the site using a CMS. (Probably, more Areas will follow later on.)

How do I structure my project best? Should I ...

create the Area Dashboard and put the stuff belonging to the Website part into the main application folder or should I create both Areas Website and Dashboard?

Additionally, where should I place my Entity Data Model and the corresponding Repository classes that have to be accessed by both Areas?

View 1 Replies

MVC :: Designing The Class Libraries Structure?

Jan 12, 2011

I am starting an MVC application and designing the class libraries structure at the moment. I started off with the following class library structure as below.

[code]....

As there will be about 3-4 developers working on the project I thought it might be useful to split out each section of the application into their own class libraries so each developer can work on a different section without interferring with each other.

In our application we have 5 tabs e.g. Dashboard, Admin, Reports, Editor, Subscribers. Would it be wise to put each tab into its own class library like below.

[code]....

View 1 Replies

Architecture :: Trying To Create A Project Structure?

Jun 3, 2010

I am using asp.net 3.5 and I am trying to create a project structure (asp.net web solution with UI/Business/Data access) which would be like a base and ready for any new projects in my team and all could use this standard structure only as a base(outer boundary) and they can expand the structure. Also adding on to it I wanted to include certain features like adding libraries of reusable code/functions, so that every team member could use functions from my library within this base structure. To summarize the above, I need to create standard .net project structure/framework/architecture with resusable code library included in it. How can I do this..

View 4 Replies

Architecture :: User Directory Structure?

Feb 7, 2010

I'm building a site that can possibly have millions of users (yes ambitious!). Each user can upload an image or two for his/her profile. How would you architect the directories to support this type of thing? I was thinking of having a users subfolder off the root dir where each user will have their own sub-dir that corresponds to their userId created at registration time. I could then upload their profile pics to their corresponding sub-directory under the users dir. Seems straightforward but am I missing anything? Can I have a million sub-dirs under the user dir? NTFS supports it so my guess is YES.

View 2 Replies

Web Forms :: Specific Directory Structure?

Jun 14, 2010

I am working on an ASP.NET application which has one data entry form. this form contains one field which takes Path for existing webforms.Suppose i have a form name "XYZ.ASPX" inside my working directory eg. "WEBPAGESXYZ.ASPX"Now my requirement is "Can i have a browsing control which will restrict me to browse pages and user controls in my wrking directory only and not the whole computer"

View 3 Replies

SQL Server :: How To Copy Table Structure From One PC To Another PC

Aug 19, 2010

how to copy table structure or whole table from sql server 2005 from one PC to another PC

View 7 Replies







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