C# - Sharing Domain Logic Between Similar Classes In Architecture?

Mar 24, 2011

My MVC ASP.NET web application is split up like this:

Web Application Layer Views

[Code]....

Now, I have a view in the database called "EquipmentWithCableDetails", which contains additional useful information with the equipment details - so I create a class to model that view (in order to be able to read from it). In the code I have that works with that new class, I want to display the EquipmentDescription - but that property only exists on the Equipment class.

View 2 Replies


Similar Messages:

Architecture :: Two Different Base Classes Sharing Some Of The Same Code?

Mar 21, 2011

I got loads of website, that share one of two baseclasses. I need the two baseclasses to be able to share part of the same code. I dont want to have to duplicate the shared code per baseclass.

so.. I got a page.aspx that inherits the baseclass and that inhertis 'sub' baseclass that inherits the web.ui.page class. So far so good :-)

In my baseclass I got a Public (at the top of the class not in any method- not sure of the proper term) Varable that is constructed from a structure in the BO class.

it Public PageDetails AS CoreDomainSetupBO.GetStartUpDetails = {database method}

I need the pagedetails to be available in the sub baseclass but it cant be defined there as the page details value is defined differently in the different base classes.

I hope that makes sense, I need to sub base class to be able to use a property that is defined at baseclass level.

View 3 Replies

Architecture :: Sharing Classes In Between Two Associated Projects In One Solution?

Dec 3, 2010

I am looking for general direction on the best practice here. I have a class that I want to share between two different forms in two projects that are associated. The two forms are in seperate projects but both projects load together as I have added the second project to the first. I also have a class that I want to share between these two projects which will cause me to add another project to this solution with will mean I will have three projects in my solution. My question is how do I best share this class?

I believe the only way to do this is to add the class in the reference in both of the form projects?... Is this correct ? I'd really like to just reference the class and inherit it in the source code without adding it as a reference but I am feeling that I can't do that. I am obviously pressed for time and working on other projects and a I am a experienced coder with only about 1 year of C# experience...

View 4 Replies

State Management :: Sharing Cookies Between Domain / Sub Domain?

Jul 28, 2010

I have a main domain "mydomain.com" and then a sub domain "forums.mydomain.com". If a user visits "forums.mydomain.com" without being logged in, they are redirected to "mydomain.com/login.aspx".

The two scenarios are:

If they are redirected to the login page with "mydomain.com/login.aspx?ReturnUrl=http://forums.mydomain.com", then they are succesfully logged into the forums but NOT the main site.

If they are simply redirected to the login page with "mydomain.com/login.aspx" with no returnUrl, they are correctly logged into both the main site and the forums.

View 2 Replies

C# - How To Test Wildcard Domain Logic

Nov 28, 2010

Here is an interesting problem... I have configured wildcard domains on my production site and will be using it as a customer identifier. This allows me to display the right banner/css/logos for each customer simply be pulling out the wildcard prefix (eg. CompanyABC.website.com will be displayed the logos and branding related to CompanyABC).

But how do I test this on my local Visual Studio 2010 installation? In production the site loads COMPANY.website.com etc., but locally I can only use the flat http://localhost address.

View 3 Replies

How To Setup For Sharing Code Across Multiple Domain Names

Mar 8, 2010

I have built a website and now the customer wants to split it between three different domains. What is the best way to do this? This is what I have so far.

c:/website1/ points to www.website1.com
c:/website1/vd1/ points to www.website2.com
c:/website1/vd2/ points to www.website3.com

The webhost I'm working with has done it the following way, but now I'm getting a bunch of errors that seems like it's not seeing the App_code folder. Do I need to make a lot of changes? How does this affect the location references?

View 2 Replies

State Management :: How To Disable Session Sharing Among Different Applications With Same Domain

Jul 14, 2010

I have 2 applications App1 and App2 on same domain, both with Forms authentication, each using a different database instance for authentication.

First, I open a browser with application www.mydomain.com/App1 and log on.

After that, when I open another instance of the same browser with application www.mydomain.com/App2 and log on, first browser loses session and goes back to login page.

I need each application on same domain to have its own session so that both can stay logged on.

View 2 Replies

Architecture :: Sharing Data Between Two Different Applications

Feb 17, 2010

I have to different .Net applications running simultaneously. Assume both are windows / web applications.When I update some data in application A

correspondingly data in application B must be updated.

View 3 Replies

Architecture - Removing Session Calls From Business Logic?

Feb 4, 2011

I've inherited an asp.net web solution, which has business logic and data calls as seperate assemblies. In the business layer there are a small number of calls to get/set HttpContext session values. I've looked around for an example that will allow me to abstract this away from the business logic as I'd like to be able to reuse these assemblies in non-web projects, could anyone please give me an example of the best way to do this. I was thinking of some sort of session factory that will obtain values from some sort of persistant store depending on the usage scenario but I'm new to architecture really and would appreciate a pointer or two.

View 3 Replies

Architecture :: Extending The Screen / Table With Validation And Bisiness Logic?

Jun 17, 2010

I have a typical design problem, pls give me your ideas. We are developing a ASP.NET application and my clients wants to add new fields on the screen at runtime (we have more than 100 screens). Fields which may not be in the table, and bind to a newly created table (dynamically), add validations and business logic to it. My though is to create a separate table to allow extending the existing tables, but not sure how I can link the business logic, validations to it. Also the reporting part.

View 1 Replies

Architecture :: Separating BLL And DAL When Not Using Classes

Mar 9, 2011

I'm implementing n-tier structure in the current app I'm working on. Because DataBinding a list of my Objects to a Repeater was far too slow I need to databind a DataTable to the Repeater. Should I still DataBind to a Function (that returns a DataTable) in the BLL that calls a Function in the DAL that returns a DataTable?

View 2 Replies

Architecture :: Best To Make Classes In VB, VB.NET OR C#?

Nov 29, 2010

1. Desktop based application - Developed in VB2. Web based application - Developed in Asp.Net 2.0 and C#The above two uses same database in SQLI do have proper class library/business logic in desktop based application in VB. Now I need to use the same library in ASP.net web based application so that I can change at one place and both the versions will work fine with replacement of one dll.hat is the best to make classes in VB, VB.NET OR C# so that I can use at both end easily.1. If I write Activex dll in vb, the internet articles tells about low performance because of Interop services.

View 2 Replies

Architecture :: Can An Assembly Contain More Than One Classes?

May 12, 2010

I want to know Can an assembly contains more then one classes?

View 1 Replies

Architecture :: How To Create Wrapper Classes

Nov 24, 2010

I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.

View 6 Replies

Architecture :: Finding Best Practice For Designing Classes - OOP

Aug 10, 2010

I am searching for what are the standard best practice (for OOP) used to design classes for develop asp.net application? I am aware of most of the OOP concepts but confused with how to map object/classes.

Let's take example of Adventure works - 2005 database provided by Microsoft; it has five schemas Sales, Purchase, Person, Production, HR and DBO.

Should we consider Schemas as Namespace in Classes?

Now, Person schema has 5 tables, should we design classes based on tables?

i.e. Person schema has Address, AddressType, Contact, ContactType, CountryRegion & StateProvince tables. What are the classes we can consider?

What are the basic criteria to decide objects? What to do and how to design classes for tables like Purchase order detail, Product cost history, Product inventory, Product Category etc.

View 3 Replies

Architecture :: Using DataSets Alongside Linq To SQL Classes?

Feb 22, 2010

I am updating a project I wrote some time ago. At the time my preference was for DataSets and DataSetTableAdapters, but I've now moved on to use Linq to SQL DataClasses. I would like to convert the project to Linq to SQL, but I am tight on time and it's a big job. My question is, is there any reasons I can't develop new modules using Linq to SQL DataClasses along side DataSets and convert the DataSets overtime?

Apart from the obvious confusion it will cause, are there any technical problems I should be aware of i.e. will there be any performance problems using the two methods?

View 4 Replies

Security :: Using Membership Classes In 3 Tier Architecture?

Nov 3, 2010

Can we use membership class in 3 tier architecture? Actually i want to use ASP.NEt's login control and membership for authentication. Can it will be possible in 3 tier using membership.

View 5 Replies

Architecture :: Should Let External Classes Access Webform Controls

Sep 24, 2010

I was wondering if you should write code so that external classes and functions of that external class can access the webform controls in the main class???

Or should you only use the external class to process some data, return that data back to the main class (that instantiated that external class object) and then have an internal function in the main class to deliver the data to the control? (back to the screen)

View 2 Replies

Architecture :: Building Layered Web Applications / Where To Create The BLL And DAL And All Classes

Dec 23, 2010

where to create the BLL and DAL and all classes in it can we place them in the App_code folder as it ll convert them into DLL Files or do we have to create a new class library project for each...

View 1 Replies

Architecture :: Data Binding To Entity Framework Classes?

Feb 1, 2011

I am using the ADO.NET Entity Framework for loading data from the database. The classes are directly mapped to database tables in the database. The problem is that these classes are not optimal for binding to the UI elements. As a result of this I have some custom entities which are populated at the service layer and returned. It is these custom entities (classes) to which I bind the UI elements. My questions on this are1. Is populating these entities at the service layer the most appropriate way to do this. I personally do not think so because if we introduce some additional UI elements which need different entities then I have to modify the service layer again.2. What is the best approach/pattern to get this done.

View 2 Replies

Architecture :: Finding Pros And Cons Of Static Classes And Variables (particularly A Db Connection)

Jan 11, 2010

So I started working on my first asp.net application that involves logging in and databases, and soon after i started messing around with a static class. I "discovered" that if you make a variable static, all sessions share that variable (I for some reason was originally assuming that each session had its own copy of that "static" class). Anyway, after discovering this I thought to myself "how could this possibly be useful to me" and thought that itmight be a good idea to make a single static database connection for all of the sessions, rather than storing that as a session variable for each session. Does anybody know what would be the pros and cons of this approach?

View 5 Replies

Architecture :: Domain Design Concern?

Mar 20, 2010

All the users of my system get a common Id (SystemUserId). There are predefined roles/groups in the system. One user can be belong one or more of these groups. We are populating the menu/dashboard at runtime according to logging credentials.All common details (properties) of group are stored in main table (SystemUser) and specialized details are stored in relavant tables.(Teacher/Student). My solution already has classes called, SystemUser, Teacher & Student.

Problem:My system should support new group addition. (eg-: Auditor)This should support new properties to be added to SystemUser/Teacher/Student or any other new group added by the Customer at runtime.

View 4 Replies

Architecture :: How To Desigin The Domain Model

Jun 28, 2010

know whats is happening and why its throwing an error (it does not find GetBrokenRules method because its List) but the reason i posted this question here is to ask for a better design, can anybody guide me here please?i am working on Facilities class (List..../Building/Floor) rror:Error 3System.Collections.Generic.List' does not contain a definition for 'GetBrokenRules' and no extension method 'GetBrokenRules' accepting a first argument of type 'System.Collections.Generic.List' could be found (are you missing a using directive or an assembly reference?)

View 2 Replies

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 :: Database Backed Entity Classes And Matching The Underlying Types For The ID Field

Jul 16, 2010

Database backed entity classes and matching the underlying types for the ID field. removed.

View 1 Replies







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