473,769 Members | 4,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System Architecture Advice

Hi All,

I have a web application with the usual 3 layers; presentation, business,
and DB.

We are just about to start work on a new project with a totally separate
presentation layer, but will use SOME of the existing business functionailty
and the same DB. Functionailty to be re-used will be a User object for
example.

I was going to introduce a 4th "common" business layer, which will sit above
the business layer for each site (existing and new). This common business
layer will contain the User object, with the other existing layers inheriting
this object.

Is this the best way to go about it?

If so - I have a problem with enumeration... say I have a UserType
enumerator in my User object. As soon as I move this to the new common
layer, it breaks my code in the presentation layer (because presentation
layer references existing business layer, but does not directly reference the
new common business layer).

Can anybody help with this?

Cheers.
Jul 22 '05 #1
4 1125
Using inheritance is the approach that I would recommend. As you mentioned though, it will require you to reference the "common"
BOL in all of your apps. The common BOL should probably be a stand-alone class library so that multiple projects can reference it.

Is there a particular reason why this is a problem for you?

The other option is to simply rewrite all of the code, every time you need it, like in legacy apps. What a nightmare! ;)

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:38******** *************** ***********@mic rosoft.com...
Hi All,

I have a web application with the usual 3 layers; presentation, business,
and DB.

We are just about to start work on a new project with a totally separate
presentation layer, but will use SOME of the existing business functionailty
and the same DB. Functionailty to be re-used will be a User object for
example.

I was going to introduce a 4th "common" business layer, which will sit above
the business layer for each site (existing and new). This common business
layer will contain the User object, with the other existing layers inheriting
this object.

Is this the best way to go about it?

If so - I have a problem with enumeration... say I have a UserType
enumerator in my User object. As soon as I move this to the new common
layer, it breaks my code in the presentation layer (because presentation
layer references existing business layer, but does not directly reference the
new common business layer).

Can anybody help with this?

Cheers.

Jul 22 '05 #2
Thanks Dave - great reply.

Below is a simple diagram of my ideal solution.

Pres A Pres B
| |
| |
Bus A Bus B
| |
---------- ----------
|
Bus Common

There is no particular reason why I didn't want to reference the common BOL
from all apps apart from I thought it would be a bit redundant having to
reference two BOL's instead of just the one, which then referenced the common
BOL. I also thought it would enforce better use of the different BOL's
amongst the developers.

I have managed to do this by marking objects in the Common BOL
"MustInheri t". Bus A and Bus B then reference common ad inherit the common
user class. The only problem is the Enumerations which exist in the common
BOL is not accessible from any of the presentation layer apps.

The two options I see are to implement the solution you suggested Dave, or
to somehow get around the Enum problem.

Is there another way that I have not thought of?

Cheers

"Dave" wrote:
Using inheritance is the approach that I would recommend. As you mentioned though, it will require you to reference the "common"
BOL in all of your apps. The common BOL should probably be a stand-alone class library so that multiple projects can reference it.

Is there a particular reason why this is a problem for you?

The other option is to simply rewrite all of the code, every time you need it, like in legacy apps. What a nightmare! ;)

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:38******** *************** ***********@mic rosoft.com...
Hi All,

I have a web application with the usual 3 layers; presentation, business,
and DB.

We are just about to start work on a new project with a totally separate
presentation layer, but will use SOME of the existing business functionailty
and the same DB. Functionailty to be re-used will be a User object for
example.

I was going to introduce a 4th "common" business layer, which will sit above
the business layer for each site (existing and new). This common business
layer will contain the User object, with the other existing layers inheriting
this object.

Is this the best way to go about it?

If so - I have a problem with enumeration... say I have a UserType
enumerator in my User object. As soon as I move this to the new common
layer, it breaks my code in the presentation layer (because presentation
layer references existing business layer, but does not directly reference the
new common business layer).

Can anybody help with this?

Cheers.


Jul 22 '05 #3
Since the presentation layer should probably be unaware of base BOL implementations , which I see is your ultimate goal, then you
could just implement different method overloads on BOL classes that call a protected (not sure of the VB keyword) method on the base
class and pass the appropriate enum value. This will abstract the presentation layer from the need to specify explicit enumeration
values.

This may not work with your design and use of the Enum in question. Here's an example of what I mean:

GUI --> BOL.DoSomething Cool() --> AbsBOL.DoSometh ing(Something.C ool)
GUI --> BOL.DoSomething Neat() --> AbsBOL.DoSometh ing(Something.N eat)

Make sense?

If you truly require the "Something" Enum to be visible for use by the GUI, you can take the base type of the enum as a parameter
and cast it in the base implementation:

GUI --> BOL.DoSomething ( 1 ) --> AbsBOL.DoSometh ing ( (Something) 1)
GUI --> BOL.DoSomething ( 2 ) --> AbsBOL.DoSometh ing ( (Something) 2)

Of course, you can define your own enums in each GUI that you create. Unfortunately, it's not reusing any code and therefore may
become a maintainance nightmare:

GUI --> BOL.DoSomething ( (int) GUISomething.Co ol ) --> AbsBOL.DoSometh ing ( (Something) 1)
GUI --> BOL.DoSomething ( (int) GUISomething.Ne at ) --> AbsBOL.DoSometh ing ( (Something) 2)
I think your best bet for maintainance would probably be to add a reference in the presentation layers to the common business layer,
or go with the first solution I've offered above if it fits your use of the Enum.
--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:7D******** *************** ***********@mic rosoft.com...
Thanks Dave - great reply.

Below is a simple diagram of my ideal solution.

Pres A Pres B
| |
| |
Bus A Bus B
| |
---------- ----------
|
Bus Common

There is no particular reason why I didn't want to reference the common BOL
from all apps apart from I thought it would be a bit redundant having to
reference two BOL's instead of just the one, which then referenced the common
BOL. I also thought it would enforce better use of the different BOL's
amongst the developers.

I have managed to do this by marking objects in the Common BOL
"MustInheri t". Bus A and Bus B then reference common ad inherit the common
user class. The only problem is the Enumerations which exist in the common
BOL is not accessible from any of the presentation layer apps.

The two options I see are to implement the solution you suggested Dave, or
to somehow get around the Enum problem.

Is there another way that I have not thought of?

Cheers

"Dave" wrote:
Using inheritance is the approach that I would recommend. As you mentioned though, it will require you to reference the "common"
BOL in all of your apps. The common BOL should probably be a stand-alone class library so that multiple projects can reference
it.

Is there a particular reason why this is a problem for you?

The other option is to simply rewrite all of the code, every time you need it, like in legacy apps. What a nightmare! ;)

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:38******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I have a web application with the usual 3 layers; presentation, business,
> and DB.
>
> We are just about to start work on a new project with a totally separate
> presentation layer, but will use SOME of the existing business functionailty
> and the same DB. Functionailty to be re-used will be a User object for
> example.
>
> I was going to introduce a 4th "common" business layer, which will sit above
> the business layer for each site (existing and new). This common business
> layer will contain the User object, with the other existing layers inheriting
> this object.
>
> Is this the best way to go about it?
>
> If so - I have a problem with enumeration... say I have a UserType
> enumerator in my User object. As soon as I move this to the new common
> layer, it breaks my code in the presentation layer (because presentation
> layer references existing business layer, but does not directly reference the
> new common business layer).
>
> Can anybody help with this?
>
> Cheers.


Jul 22 '05 #4
Thanks Dave - I really appreciate your time.

"Dave" wrote:
Since the presentation layer should probably be unaware of base BOL implementations , which I see is your ultimate goal, then you
could just implement different method overloads on BOL classes that call a protected (not sure of the VB keyword) method on the base
class and pass the appropriate enum value. This will abstract the presentation layer from the need to specify explicit enumeration
values.

This may not work with your design and use of the Enum in question. Here's an example of what I mean:

GUI --> BOL.DoSomething Cool() --> AbsBOL.DoSometh ing(Something.C ool)
GUI --> BOL.DoSomething Neat() --> AbsBOL.DoSometh ing(Something.N eat)

Make sense?

If you truly require the "Something" Enum to be visible for use by the GUI, you can take the base type of the enum as a parameter
and cast it in the base implementation:

GUI --> BOL.DoSomething ( 1 ) --> AbsBOL.DoSometh ing ( (Something) 1)
GUI --> BOL.DoSomething ( 2 ) --> AbsBOL.DoSometh ing ( (Something) 2)

Of course, you can define your own enums in each GUI that you create. Unfortunately, it's not reusing any code and therefore may
become a maintainance nightmare:

GUI --> BOL.DoSomething ( (int) GUISomething.Co ol ) --> AbsBOL.DoSometh ing ( (Something) 1)
GUI --> BOL.DoSomething ( (int) GUISomething.Ne at ) --> AbsBOL.DoSometh ing ( (Something) 2)
I think your best bet for maintainance would probably be to add a reference in the presentation layers to the common business layer,
or go with the first solution I've offered above if it fits your use of the Enum.
--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:7D******** *************** ***********@mic rosoft.com...
Thanks Dave - great reply.

Below is a simple diagram of my ideal solution.

Pres A Pres B
| |
| |
Bus A Bus B
| |
---------- ----------
|
Bus Common

There is no particular reason why I didn't want to reference the common BOL
from all apps apart from I thought it would be a bit redundant having to
reference two BOL's instead of just the one, which then referenced the common
BOL. I also thought it would enforce better use of the different BOL's
amongst the developers.

I have managed to do this by marking objects in the Common BOL
"MustInheri t". Bus A and Bus B then reference common ad inherit the common
user class. The only problem is the Enumerations which exist in the common
BOL is not accessible from any of the presentation layer apps.

The two options I see are to implement the solution you suggested Dave, or
to somehow get around the Enum problem.

Is there another way that I have not thought of?

Cheers

"Dave" wrote:
Using inheritance is the approach that I would recommend. As you mentioned though, it will require you to reference the "common"
BOL in all of your apps. The common BOL should probably be a stand-alone class library so that multiple projects can reference
it.

Is there a particular reason why this is a problem for you?

The other option is to simply rewrite all of the code, every time you need it, like in legacy apps. What a nightmare! ;)

--
Dave Sexton
dave@www..jwaon line..com
-----------------------------------------------------------------------
"mallen" <ma****@discuss ions.microsoft. com> wrote in message news:38******** *************** ***********@mic rosoft.com...
> Hi All,
>
> I have a web application with the usual 3 layers; presentation, business,
> and DB.
>
> We are just about to start work on a new project with a totally separate
> presentation layer, but will use SOME of the existing business functionailty
> and the same DB. Functionailty to be re-used will be a User object for
> example.
>
> I was going to introduce a 4th "common" business layer, which will sit above
> the business layer for each site (existing and new). This common business
> layer will contain the User object, with the other existing layers inheriting
> this object.
>
> Is this the best way to go about it?
>
> If so - I have a problem with enumeration... say I have a UserType
> enumerator in my User object. As soon as I move this to the new common
> layer, it breaks my code in the presentation layer (because presentation
> layer references existing business layer, but does not directly reference the
> new common business layer).
>
> Can anybody help with this?
>
> Cheers.


Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
5627
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases - SQL Server, Oracle and AS400. The business layer exposes web services which communicate with the front end, ASP.Net. All 3 tiers are on different boxes. This works well. Now I am leading a team to build a winforms app. I need some advice as
0
1424
by: DKode | last post by:
Ok, My company is asking me to build a portal site for managers. I think I have it down how I will structure the app, using C# and module based pages like in the ibuyspy portal example. I plan on using Authorization Manager to define the roles and authentication will be done in active directory. My question has to do with this: All managers have a directory already like so:
2
1451
by: dee | last post by:
hi, I considering designing a online snipe system. This where i input a price and the application will submit the snipe at the desired time to the site. I have been thinking about the design of the system at a higher level view and wanted some ideas on what would be the best design of the system in terms of performance , managability and scallability. I was thinking of three database tables , one not very urgent , urgent and very urgent ....
2
1572
by: Andrew | last post by:
I am starting my first C# project and have a design issue which I would appreciate some advice about. I am wondering whether to use dataset to pass information between components or if I should implement components and collections. I wondered what the advantages and disadvantages of both approaches were in .NET. I am at the start of the project and would like to make the right decision. My last project was VB and MTS and we used recordsets as a...
3
1296
by: Johnny Meredith | last post by:
Hi, I'm relaively new to programming languages in general, and brand new to VB.NET. I use/used VBA in MS Access previously to do what I needed. I want to learn VB.NET to stretch my boundaries a bit. Anyway, I'm developing an application to track the progress of tax audits. Originally, I thought I would write objects something like this:
5
3037
by: Tamir Khason | last post by:
Friends, maybe someone knows good references for .NET plugin based program architecture. E.g I want to be able to "put" class library(dll) in some place (where I do not the name of the class, but only structure ) and use it "plug-and-play" in main procedure without recompilation -- Tamir Khason You want dot.NET? Just ask: "Please, www.dotnet.us "
0
892
by: Brian | last post by:
Tim- Might I suggest you take a look at book by WROX titled ASP.NET Website Programing Problem - Design - Solution Visual Basic .net Edition The ISBN is 1-86100-816-3 This book offers some design patterns for each tier of a 3 tier business application. The DB layer patterns have been very useful to me and echo what Chris has posted in
6
1409
by: V. Jenks | last post by:
I apologize if this is the wrong forum for this, I could not locate one that was exactly appropriate for this topic. Over the last couple of years I've been doing a lot of reading on design patterns and different types of architectures for building high-performance, scalalble n-tier apps. I've used business objects for a while, since moving to C# and asp.net from classic asp but I'm wondering how I can
17
3347
by: Big Charles | last post by:
Hello, Recently, a friend of mine has told me that he is a .NET System Architect. What is a .NET System Architect? What are their functions? What is the difference between an Architect and a programmer and a System Analyst? Thanks for your help !
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9999
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.