473,389 Members | 1,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,389 software developers and data experts.

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 1093
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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:38**********************************@microsof t.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
"MustInherit". 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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:38**********************************@microsof t.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.DoSomethingCool() --> AbsBOL.DoSomething(Something.Cool)
GUI --> BOL.DoSomethingNeat() --> AbsBOL.DoSomething(Something.Neat)

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.DoSomething ( (Something) 1)
GUI --> BOL.DoSomething( 2 ) --> AbsBOL.DoSomething ( (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.Cool ) --> AbsBOL.DoSomething ( (Something) 1)
GUI --> BOL.DoSomething( (int) GUISomething.Neat ) --> AbsBOL.DoSomething ( (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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:7D**********************************@microsof t.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
"MustInherit". 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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:38**********************************@microsof t.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.DoSomethingCool() --> AbsBOL.DoSomething(Something.Cool)
GUI --> BOL.DoSomethingNeat() --> AbsBOL.DoSomething(Something.Neat)

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.DoSomething ( (Something) 1)
GUI --> BOL.DoSomething( 2 ) --> AbsBOL.DoSomething ( (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.Cool ) --> AbsBOL.DoSomething ( (Something) 1)
GUI --> BOL.DoSomething( (int) GUISomething.Neat ) --> AbsBOL.DoSomething ( (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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:7D**********************************@microsof t.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
"MustInherit". 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..jwaonline..com
-----------------------------------------------------------------------
"mallen" <ma****@discussions.microsoft.com> wrote in message news:38**********************************@microsof t.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
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...
0
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...
2
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...
2
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...
3
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...
5
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...
0
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...
6
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...
17
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...

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.