DDD Approach Be Used With NHibernate?
Nov 12, 2010
I've been reading up on DDD a little bit, and I am confused how this would fit in when using an ORM like NHibernate. Right now I have a .NET MVC application with fairly "fat" controllers, and I'm trying to figure out how best to fix that. Moving this business logic into the model layer would be the best way to do this, but I am unsure how one would do that.
My application is set up so that NHibernate's session is managed by an HttpModule (gets session / transaction out of my way), which is used by repositories that return the entity objects (Think S#arp arch... turns out a really duplicated a lot of their functionality in this). These repositories are used by DataServices, which right now are just wrappers around the Repositories (one-to-one mapping between them, e.g. UserDataService takes a UserRepository, or actually a Repository). These DataServices right now only ensure that data annotations decorating the entity classes are checked when saving / updating.
In this way, my entities are really just data objects, but do not contain any real logic. While I could put some things in the entity classes (e.g. an "Approve" method), when that action needs to do something like sending an e-mail, or touching other non-related objects, or, for instance, checking to see if there are any users that have the same e-mail before approving, etc., then the entity would need access to other repositories, etc. Injecting these with an IoC wouldn't work with NHibernate, so you'd have to use a factory pattern I'm assuming to get these. I don't see how you would mock those in tests though......................
View 3 Replies
Similar Messages:
Nov 28, 2010
I am using nhibernate in an open session per view approach where the session opens before the action method and closes right after. Using an AsyncController makes this model break because the controller performs data operations even when it has returned from the original XXXAsync method but it finds a null session while the HttpContext.Current is null as well. Is there any way to fix this issue?
View 1 Replies
Aug 5, 2010
What is the best approach to one to many relationships?
This is my scenario:
I have a simple one to many relation:
Customer
CustomerID
Name
tel
CustomerNotes
Id
Note
customerID
I want to have a DETAIL view of customers and CREATE view for CustomerNotes all in the same page.
I create CustomerController and the different views and its respective actions for edit, create, delete, etc.
I also create a CustomerNotesController and the views and actions like before, but I made the views PARTIALS
I put a RENDERPARTIAL for the CustomerNotes create view in the Details view from Customer.
When I run the app, the page is render as expected: It shows the detail info of the customer and bellow the create form for the notes. However, when I click SAVE, nothing happens. I put a breakpoint in the notes controller and never get hit.
I also try with RenderAction and don't work at all.
View 4 Replies
Aug 25, 2010
I am looking into the possibility of shortening / encrypting a url which will be from 150 to 250 characters in length to maximum 12 characters using an algorithm. Initially I am doubting it's possible but I wanted to leverage the great minds of StackOverflow :)
the algorithm should be one that can be written in classic asp, sql, c#, vb, or foxpro or other language.
Is that even possible without a database centric approach?
I was reading here that AES in CFB mode, will do a stream cipher and the output length will be the same as the input length. Is there any way to shorten it even more?
View 4 Replies
Oct 25, 2010
I am developing a CMS application. Its a very huge deep and with full of configurable features. Current, I am developing it using Asp.net C#, form authentication and by creating UserControls.
There are lot of configurable items need to decide at run time as per user roles and some rules are predefined and some will be defined by Admin at runtime. The all information is stored in DB. I am getting lot of issues with USerControls. I consulted with some other guys who told my approach is wrong, I should go through DB data fetching. I really don't understand what is it? It is something like my all pages will be stores in Database and will construct at runtime and display as per rights?
View 2 Replies
Dec 14, 2010
I was planning to utilize MVP, DDD, TDD, IOC, Dependency Injection, Repository , StructureMap etc but the timeframe is very tight and this can also be achieved in n -tiered architecture:
Technology:
Client Web Portal
ASP.Net /C#/SQL Server
Project Specification:
5 types of customers
Template of service
Dynamic Data Driven portal
Modules can be activated/deactivated through management console
Branding and customization
Rapid deployment portals of future clients as well
Portals willallow for customization
Data reporting services: reports and
BOBJ Ad hoc Query
Value- Add services to the clients
portal
Each Clients welcome page can be
customized by client as well
How can I determine which Client is
on "Welcome" page without them
logging in? Create different URLS for
each client base? how?
Mobile Application services
Localization
Demo portal should be built and sent
to client for testing rapidly
Database structure:
There will be core database which will be connected to 50-60 client databases depending on the login and other details.
What is the best approach in terms of data layer? since dynamic db connections will have to be implemented?
View 5 Replies
Mar 25, 2010
Do you guys know a good website or a good tutorial to manage this.
View 4 Replies
May 8, 2010
I have a situation where I need to maintain a large number of related integer values in my ASP.Net 3.5 application. The SortedList seems perfect for this purpose. If this were a Windows app I'd just create a class and setup one method to Set values within the SortedList and another one to Get values out of it.
But being a web app, I'm not entirely sure of the best approach to use. Sure, I could just create one method for Set and another for Get but that doesn't seem very "clean".I thought about creating a UserControl without any visual elements but am not sure if that makes sense.How would you go about implementing such a SortedList in your web app?
View 7 Replies
Oct 1, 2010
I am looking to implement a Wizard for my Web Form, please could somebody give me suggestions as to which approach would be best jQuery or ASP.NET Wizard control? give links describing the implementation, if possible.
View 1 Replies
Dec 21, 2010
I landed on a job to continue working on exisiting asp.net 3.5 application using Visual Studio 2008. The former .net developer is no longer around and I have to dig into the application code to understand how the app works( workflow, logic, etc...)I have added new development to the existing application and enhanced existing pages. Now, I need to provide Technical documentation for the application so any new developer comes onboard will not struggle enhancing the app or do new development following the same methodology . Q1. What is the best approach to provide technical documentation.I thought of the following
View 1 Replies
Feb 10, 2011
We need to deploy our asp.net web site in web farm which consists of 16 web servers. Whenever we need to roll out a new release it is very time consuming and tedious as we need to deploy it first on the DR environment (16 web servers) and then on to Live environment (16 web servers). Currently we prepare the msi on our build server and copy it on all the front end web servers which involves first FTPing the msi to a common location on hosting network and then copying from the common location to each server.
After thet we backup the existing website and then run the installer one by one on each machine
View 1 Replies
Jun 25, 2010
I have hosted a secure WCF service on cloud with a certificate created by makecert.
Now I want to restrict the access to the service by allowing only those clients who have the certificate generated by me.
What is the best approach to implement this
* Shall I go with the changes in the configuration file
* Or Shall I write the code to validate this in the service
* Is there any other alternative?
View 1 Replies
Jan 7, 2011
I do have a log system and the correct error is well explicit there, but I want to give a better message to the user.
I keep trying several ways but I'm using Telerik components and well jQuery and I ended up using both ASP.NET Ajax methods and jQuery, so I use
function pageLoad() {
try { [code]....
as well$(document).ready(function() { ... }
that alert(err) is never fired even upon OnClick events
what's the best approach to avoid this message errors and provide a cleaner way?
all this happens in <asp:UpdatePanel> as I use that when I didn't know better (3 years ago!) and I really don't want to mess up and build all again from scratch
Updated with more error windows after volpav solution
View 3 Replies
Dec 29, 2010
What is the approach? calc: BL vs. DB?
Using Asp.net3.5/ sql2005.
What is the approach? What should calculate in the database and what to implement in the business lyre??
If I will calculate in the db - I will have less round trips and less resources on the server side host - but less flexible programmatically side..
When to use object oriented programming and when to implement the calculation on database - when what I am looking for is first performance.
View 12 Replies
Mar 3, 2011
I'm designing a mid sized business app in asp.net / c# Framework:4.0 environment.
I'm just wondering which is the best approach for designing data access layer.
Candidates designs are:
1. ADO.Net
2. LINQ using sps or LINQ with Entities
3. Hibernate object model
View 2 Replies
Jul 22, 2010
There are various ways to handle session timeouts, like "meta refreshes" javascript on load functions etc.
I would like something neat like: 5 minutes before timeout, warn the user...
I am also contemplating keeping the session open for as long as the browser is open(still need to figure out how to do it though... probably some iframe with refreshing).
How do you handle session timeouts, and what direction do you think i should go in?
View 3 Replies
Sep 29, 2010
What is the most correct way to save your connection string when using the n-tier approach ? Right now I have two windows app and one web app using my DLL library, what I'm currently doing is to create a static
method inside my dal "GLOBALDAL"
inside I'm making this check:
Code:
if (System.Web.HttpContext.Current != null) ...
if httpContext.Current is null
That's mean that one of my windows applications doing the request, if so I get the CN from a file otherwise it's mean its the website knocking on my door so I get the CN from:
Code: System.Web.HttpContext.Current.Application["ConnectionString"]
I am thinking of changing it all and just set properly in my DA layer that expose the CN as a string. But I fear of security issues. So what is the correct way?
View 21 Replies
May 12, 2010
I am involved in designing a asp.net webforms application using .NET 3.5. I have a requirement where we need to log exceptions.
What is the best approach for exception handling, given that there would be concurrent users for this application?
Is there a need or possibility to log in exceptions at a user level? My support team in-charge wants to have a feature where the support team can get user specific log files.
To give you a background, this application is currently on VB 6.0 and we are migrating it along with some enhancements. So, today the support personnel have a provision to get user specific log files.
View 2 Replies
May 18, 2010
asp.net mvc module wise approach or different controller and repository for each table approach is better?
View 1 Replies
Apr 20, 2010
I'm currently exporting a database table with huge data (100000+ records) into an xml file using XmlTextWriter class and I'm writing directly to a file on the physical drive.
_XmlTextWriterObject = new XmlTextWriter(_xmlFilePath, null);
While my code runs ok, my question is that is it the best approach? Or should I write the whole xml in memory stream first and then write the xml document in physical file from memory stream? And what are the effects on memory/ performance in both cases?
EDIT
I will indeed be using XmlTextWriter but I meant to say whether to pass a physical file path string to the XmlTextWriter constructor (or, as John suggested, to the XmlTextWriter.Create() method) or use stream based api. My current code looks like the following:
[Code]....
View 3 Replies
Jun 17, 2010
I want to create a listing view in which the record will be in this format(basically one record based on other, what mvc approach i should follow) .Basically i am using linq to sql and i have module and features in the same table with module being identified by is module =true tag . basically i am looking for suitable mvc approach. i could create a codebehind html table and rendered it here but that not i am looking for.
My table
Module1
Module1Feature
Module1Feaure2
Module1Feature3
Module2
Module2Feature Module2Feature2
Module2Feature3
Basically Please Notice that the child records are based on the parent.
View 1 Replies
Feb 22, 2011
I have the following requirement:
- During client registration, the password must be client side encrypted with SHA1 algorithm and stored in the DB
I have done that before using javascript on the client side. But it was a non MVC web app. I know I can use js again, but I'm trying to find a better approach.Using https or not is not depending on our development side, so we can not change the requirement.
View 1 Replies
Jan 28, 2010
I am using asp.net 2.0. I have been using asp.net membership provider for user management. But I think this would be more efficient if I could do this without using role and membership provider provided in asp.net.In fact I see bulky markups generated when I add login control, createuser control etc. in an asp.net web page.By saying user management, I am referring to the overall login, user activity tracking, password reset/retrieval, role management in an asp.net web application. And I want to implement efficient way to accomplish this.
View 2 Replies
Dec 24, 2010
My question is about an approach, and I am looking for tips or links to help me develop a solution. I have an .NET 4.0 web forms application that works with Forms authentication using the aspnetdb SQL database of users and passwords. A new feature for the application is a new authentication mechanism using single sign on to allow access for thousands of new users. Essentially, when the user logs in through the new single-sign-on method, I will be able to identify them as legitimate users with a role I will have something like HttpContext.Current.Session["email_of_authenticated_user"] (their identity) and HttpContext.Current.Session["role_of_authenticated_user"] (their role).
View 1 Replies
Aug 19, 2010
I have a web app that presents a list of statements pulled from the db to be ranked from "Never" to "Always" using a radioButtonList.
Some of the assessments have up to 100 statements, so I'm thinking that a ListView with paging and a RequiredFieldValidator for the radioButtonList would keep the presentation manageable.
I would like to submit the data after all of the pages are complete but I think that would require customization, or is my approach wrong?
View 4 Replies