.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to best organize multiple WebProjects that use similar business logic

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net

We have the following setup

Current Solution:

  • Business Logic (Class Library)

  • Data Layer (Class Library containing EF,Web Services wrappers etc)

  • WebProject1

BUT we now require a new Web Project which would be almost identical to WebProject1 except for the fact that it would alter properties and input variables to functions/voids inside the Business Logic class to provide a different set of data for another completely different user. Think of Facebook as WebProject1 and Myspace as WebProject2. Same concept, same business layer almost but different products altogether.

Future Soltion

  • Business Logic (Class Library)

  • Data Layer (Class Library containing EF,Web Services wrappers etc)

  • WebProject1

  • WebProject2 (similar to WebProject1 but different authentication, different UI, different pages etc)

  • WebProject3 (possible)

Without completely destroying the Business Logic (as the class would now have to allow for 2 paths per set of input variables) how can we structure this to aviod doubling up on any code?

The delima is:

Should we maintain two Business Logic class libraries? Should we add preffixe

View Complete Post

More Related Resource Links

Logic to calculate business hours


Hi All,

I have tried searching all over the web for this logic. Got many but half of them did not match what i was looking for and half were malfunctioning.

I want to calculate business working hours between 2 datetime, where in I should be able to set the working hours as well as weekends and holidays should not be calculated.


Please help me guys... It will be a great help... 

Creating .NET Assemblies That Aggregate Data from Multiple External Systems for Business Connectivit

This article describes a quick, four-step process for creating a .NET assembly that BCS can use to retrieve external data for SharePoint Server 2010 by using Visual Studio 2010.

Multiple Applications with Similar UIs


My company is getting ready to update several applications. Two of the applications share some common functionality. One of them is a WinForms project for in-house and the other is public facing for our customers. Both of the apps support event entry (an "event" is one of our business objects) in the exact same way.

The event entry process is very complex, with lots of validation, enabling and disabling, visibility toggling, etc. Initially, the apps were developed at different times without knowing that this shared functionality would occur which lead to a lot of code duplication and a synchronization nightmare.

Going forward, I would like to choose a model that fixes this problem. I would like to have a common class (or classes) that handle ALL of the logic in one place. For the most part, we've had the UI handle the "simple" validation (required fields, valid values, etc.) and how to display the form (visibility, enabling, etc.). We then had the "complex" validation handled by our business logic layer. Personally, I thought that the display handling should have been performed at the BLL since the changing of one property affected the display of others, but that seems like it would have required me to "hook" it into the UI (e.g., UI provides reference to its controls to BLL or BLL says whatever co

How to create an activity that allows multiple exit paths similar to FlowSwitch and FlowDecision

There have been several threads around this type of request but none have provided a definitive outcome for my requirements:I am looking to emulate the FlowSwitch or FlowDecision in a custom activity so as to simplify end user workflow authoring in a rehosted environment.Currenty I am limited to linking my custom activity to a FlowSwitch or FlowDecision to allow for simple logic to be visually composed. This creates additional complexity that I am trying to avoid.I understand that these are sealed types and even the abstract FlowNode base class of these types does not have any overridable types by design as WF 4.0 favours composition over inheritance.What options do I have to accomplish my objective?If activity composition is the response to my question then could I kindly request that some samples or links to samples are provided?

Best way to implement business logic

I am trying to migrate our current SQL CRM to Sharepoint Server 2010. At first I tried using BCS but I couldn't figure out how to implement a many-to-many lookup relationship. So now I am trying to use SSIS to move the SQL data into the lists in Sharepoint. Right now, I have accounts and contacts as lists. Now I am trying to implement the business logic where an account can have multiple contacts and a contact can have multiple accounts and when a user associates a contact with an account (or vice versa), that account should automatically be associated back with the contact. It seems this cannot be accomplished with a declarative work flow like in SPD. Am I correct in thinking that the best way to implement this is with 2 sequential workflows in Visual Studio?  Also, is a workflow always preferrable to an event receiver? Thanks!

How to create an activity that allows multiple exit paths similar to FlowSwitch and FlowDecision

Hi, I saw replies about create an multi path activity and it's container and they are guid me alot but i can not setup link between two activities in my container with System.Windows.Shapes.Line . can any one help me . can any one send me a sample code please . thanks

VB code behind the Business Logic Layer ???


Hello. I was hoping for some general help and comments.

I went through a lot of the ASP.Net Web Forms Tutorials.

I also went though the whole "ASP.Net in 24 Hours" book by Scott Mictchell. I followed everything that went on in that book and built the final project successfully. I also used the tutorials here to better understand the whole Membership Provider/User tables setup that was going on in the book.

Next, I thought I would learn more about accessing data for ASP.Net since that is what most application do.

I went through the first Data Tutorial here. I seemed to understand what was going on just fine.

The second Data Tutorial seemed to just show a lot of VB code to build the Business Logic Layer. There was not much explanation about how to do it yourself.

I think I can keep going in the tutorials here. I downloaded the code from the second tutorial and went through it.I am guessing that the code in the second tutorial was given just to proceed with the overall project that is being built throughout the tutorial sequence.

I just wish I understood what is going on in those long lists of VB code. I can see some of what is going on. I don't know VB very well at all. So, what is the next step?

I have started working through a VB book. Will learning VB help me understand the code in that tu

Separate class library for controllers,models,repositories,business logic


Alright after scratching my mind for a while.. I still cant figure out how to go ahead with my architecture: http://forums.asp.net/p/1618613/4149672.aspx#4149672

nor i can find a decent link / info on it...So, iam goin to give this one more try.

Web Part remote update and centrally located business logic


Hi everyone,

We have a web application with a search engine that our customers want to integrate into their Sharepoint environment with automatic login. I'm not familiar with Sharepoint myself but have a question around the practicality of it. I realise that we have two options:

1. Display my web app in an IFRAME. The benefit of this approach is that my Sharepoint users will automatically benefit from any update made to the web app. The downside is that they cannot download any search results directly to their Sharepoint folders.

2. Create a full Web Part to "rebuild" the full user interface of my search engine for Sharepoint. The Web Part will access my web app through back-end APIs. The benefit of this approach is that users can download results directly into their Sharepoint folders. However a big downside is that anytime there's an update to the web app, I have to implement it separately on the Web Part and redeploy it. I'm discouraged by this because that means I have to update the Web Part on every customer's Sharepoint instance.


My question is. Is there option #3 that's a midway between option #1 and #2? Is there a way I can create a thin Web Part accessing "proxy" code that is centrally updateable without having to touch every Web Part deployment? Hopefully this option allows me to get the ben

How to use business logic in MVC



I've got a C# MVC 2 application using EF 4. My DAL project gets data from the Model, translates them into POCO's and returns ViewModels to the BLL which is called from the controllers.

I've set up validation attributes on the POCO classes and that works for "Required" fields etc. I would like to add business logic such as "From" has to be before the "To" date. Can this be done on the POCO classes so it is automatically validated client-side in the view?

Also, I would like to add some functionality to the BLL layer such as checking if a resource is already booked between the From and To dates to avoid double bookings. This should fire before the ViewModel is saved. I tried a Try/Catch statement in the controller so that I can throw an error in the BLL, but I don't understand how to return this error to the view with an appropriate error message added.



[Business Logic Handler debugging] - The assembly is not loaded by inetinfo.exe process


Hi there,

Here is my story - my merge replication topology consists of one publisher (sql server 2008), a distributor (same server as publisher) and a subscriber (sql server 3.5 CE). I use web synchronization for my merger replication. Publisher, Distributor, Subscriber and IIS run all on the same (development) machine. I use MSSMS to synchronize the subscriber.

I've created a custom resolver (Business Logic Handler) that should perform some data modification that has been inserted at the subscriber, before it is merged into the publisher. It should but it doesn't so I need to debug it to see what's going on. I've followed steps form here http://msdn.microsoft.com/en-us/library/ms365150.aspx on how to debug a business logic handler on a Web server using Web synchronization and I'm stuck at step 7. MY PROBLEM IS when I attache to inetinfo.exe process from VS2008, I don't see my assembly to be loaded neither in Output nor in Modules window and the break points say that they will not be hit because the symbols were not loaded.

I configured web synchronization almost exactly as it says here http://msdn.microsoft.com/en-us/library/ms151810.aspx , the only difference is that I didn't configured and

Need advice on how to use WF4 to manage my business logic in my ASP.NET MVC3 app


I want to use WF4 in my ASP.NET MVC3 app and now trying to get the hang of how WF4 should interact with the MVC app.

Say, I want WF 4 to help me with the registration process. I want new users to go through the following steps:

  1. Register
  2. Activate account
  3. Fill out personal profile
  4. Fill out professional profile

Clearly, all the registration logic and UI elements will be in the MVC3 app. I assume WF4 will be where I will check to see if the user has completed these steps.

What I'm not clear about how will WF4 tell my MVC app where to send the user? Here's what I'm thinking, please let me know if this approach makes sense

New registrations will initiate long running workflows and bookmarks will get saved in SQL Server. I will have four UI views in the MVC app with their corresponding logic in their respective controllers. How will I WF4 tell MVC what to do i.e. what URL to send the user to and what parameters to pass?

Thanks, Sam

Access business logic through a webservice


This should be fairly straightforward, but there seems to be nothing on how to do this.  So far  I've just created wrapper WebMethods and that accessed most of my methods fine, except for the one that returns an object that inherits icollection.  The error returned says to create a default accessor for the class (I don't want to touch the existing business classes, as they are being used elsewhere.)  But, I'm also sure theres many more problems along the way.  So, is there complete documentation to do this?  Or a proper tool to generate a webservice layer?


Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend