473,748 Members | 4,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Architectural design question - please advise

Hi

I'm not sure of the best way to go about achieving my goal and would
appreciate any advice.

What I would like to do is to generate a control that can be dropped onto a
web page. For example, a control that provided catalogue information. As I
envisage this, the control would be given a single argument (the end user
identifier) and it would return the required catalogue information as an
HTML page "fragment".

I'll first describe how I'd design this to work for a simple example; then,
I'll add the complexity that is causing me the design headache.

Simplistic model
-----------------

Imagine that I have three users. They navigate to a web page and expect it
to display a list of products. These users have DIFFERENT product access
permissions, so the only difference would be that the three users would see
different products. Okay, well I'd design the control to have three
layers - presentation view, business logic and data access logic.

The view would simply expect to create (say) a table containing product
details from a recordset.

The business logic would identify which products the user is allowed to see
(either in .NET code or in stored procedures or in DB relational tables)

Data access would connect to the correct database.

I think this is all fairly well understood.

My complicated model
-----------------------

Okay this is exactly the same as with the simplistic model except in this
case users 1 & 2 expect the data to be presented in a table whilst user 3
expects the data to be presented as a tree view (or whatever). So, what
we're really saying is that the view will be dependent upon the user (and
the details of which user wants which view would be held in a database).

My initial thought would be to now have 4 layers.

The top layer would be a user control with no visual aspect itself. It
simply identifies (from business logic) which view the end user requires
(tree-view or table etc). Programmaticall y it would then decide upon which
view to call. The web page would again just pass in the user identity
argument as before.

The next layer down would be a set of views (the tree view, the table view
etc). These views would all be user controls (I presume) and would all
consume the SAME set of business logic and data access logic.

My question is: Is this 4-tier design the best way to achieve my goal? If
not, what should it be...

Many thanks in advance

Griff
Sep 15 '06 #1
1 1703
I am all for separating out the actual user display from the logic to
manipulate that display (a facade layer, if you will), for the following
reasons:

1. Easier to attach unit tests to the code
2. Reusability of UI logic (tailoring multiple sites with similar
functionality primarily)
3. Ability to have two developers work on the same problem (one on UI, the
other on code)
4. Easy to switch out UI (web to windows, for example)

Are you ever thinking or can you conceive different types of UI? No brainer,
do "4" tiers
Can you use the UI logic (code part) in more than one app? No brainer again.
Yes, do it!
Do you have larger teams? Good idea to separate into libraries.
Do you do TDD (nUnit or Team System)? Then separate.

NOTE: If you are not doing TDD? Why aren't you?

One option for your control, regardless of how you divide out your tiers, is
the webpart stuff in ASP.NET 2.0. Using the webpart infrastructure, you can
make this "control" a piece a person can add and you can have different bits
of fucntionality on different parts and have them communicate with each
other.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************** *************** *************** ****
Think outside of the box!
*************** *************** *************** ****
"Griff" <ho*****@the.mo onwrote in message
news:Oq******** ******@TK2MSFTN GP06.phx.gbl...
Hi

I'm not sure of the best way to go about achieving my goal and would
appreciate any advice.

What I would like to do is to generate a control that can be dropped onto
a web page. For example, a control that provided catalogue information.
As I envisage this, the control would be given a single argument (the end
user identifier) and it would return the required catalogue information as
an HTML page "fragment".

I'll first describe how I'd design this to work for a simple example;
then, I'll add the complexity that is causing me the design headache.

Simplistic model
-----------------

Imagine that I have three users. They navigate to a web page and expect
it to display a list of products. These users have DIFFERENT product
access permissions, so the only difference would be that the three users
would see different products. Okay, well I'd design the control to have
three layers - presentation view, business logic and data access logic.

The view would simply expect to create (say) a table containing product
details from a recordset.

The business logic would identify which products the user is allowed to
see (either in .NET code or in stored procedures or in DB relational
tables)

Data access would connect to the correct database.

I think this is all fairly well understood.

My complicated model
-----------------------

Okay this is exactly the same as with the simplistic model except in this
case users 1 & 2 expect the data to be presented in a table whilst user 3
expects the data to be presented as a tree view (or whatever). So, what
we're really saying is that the view will be dependent upon the user (and
the details of which user wants which view would be held in a database).

My initial thought would be to now have 4 layers.

The top layer would be a user control with no visual aspect itself. It
simply identifies (from business logic) which view the end user requires
(tree-view or table etc). Programmaticall y it would then decide upon
which view to call. The web page would again just pass in the user
identity argument as before.

The next layer down would be a set of views (the tree view, the table view
etc). These views would all be user controls (I presume) and would all
consume the SAME set of business logic and data access logic.

My question is: Is this 4-tier design the best way to achieve my goal?
If not, what should it be...

Many thanks in advance

Griff

Sep 15 '06 #2

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

Similar topics

43
4858
by: grz02 | last post by:
Hi, Im an experienced database+software designer and developer, but, unfortunately, anything to do with web-programming and web-systems designs is still a pretty new area to me... (been working mostly with "legacy" environments the last 10 years) So I am writing this, hoping to get some useful advise and feedback... I have done some pretty trivial, small websites with html/PHP,
0
1620
by: grz02 | last post by:
Im an experienced database+software designer and developer, but, unfortunately, anything to do with web-programming and web-systems designs is still a pretty new area to me... (been working mostly with "legacy" environments the last 10 years) So I am writing this, hoping to get some useful advise and feedback... I have done some pretty trivial, small websites with html/PHP, and now starting a bit more advanced one, where I will need...
13
2379
by: Bryan Parkoff | last post by:
I have created three classes according to my own design. First class is called CMain. It is the Top Class. Second class and third class are called CMemory and CMPU. They are the sub-classes. Two sub-classes have the relationship to communicate back and forth through this pointer. The pointer is responsible inside Top class for allocating and deallocating two sub-classes. CMemory class is responsible to allocate and deallocate memory...
10
2116
by: BlueDolphin | last post by:
I'm not sure if this is a question or more of a rant... but I'm looking for some input on this from other developers out there. How often has the following happened to you and how have you dealt with it. I am consulting on a new project. Originally I was going to get data dumped to me from an external system, and import the needed data once a week into a normalized design that I had created. I knew what my fields were going to be,...
1
2419
by: E.U. | last post by:
Hi, I an using MS-Access in order to build a site. I have this item that can have upto 10 pictures (might have none) I want to design a dynamic table which has the ID of the item at the first cell (primary key) and then upto 10 cells of file names of the pictures. The problem is that I do not know in advance how much pictures will I have (since it depends of each item that is added)
2
1272
by: Viet | last post by:
I have an architectural issue that I have been working on for quite awhile now and I would like another person's point of view. This issue involves the conversion of a VB6 app to VB.NET. In this VB6 app, the original programmer used 5 timers to periodically scan a document, process it, and display thumbnail images of the scanned document. These 5 timers implement 5 different subroutines that enable this process. In my conversion of this...
0
1433
by: User | last post by:
Hi everyone, Right now, one of our client have an in-house system which stores customer profiles / data. We are building an external web based system for them which also houses the same customer profile/data. Problem is that the customer's profile data from the web based system must
2
1240
by: DC | last post by:
Hi, I have designed some data objects that I want to be filled by several providers. Do these objects typically belong into a seperate project (plus each provider is a separate project)? The providers do require a number of XML and XSLT files. I guess these belong into the webproject so the provider dll can access the files?
7
1719
by: Immortal Nephi | last post by:
I have an idea how to design an object in a better way. I would like to give you my thought example. Please let me know what you think if it is best object design. Please recommend me any book which it teaches me how to design C++ OOP better as long as I know how to program OOP in C++. Think of ancient 6502 microprocessor which it was used for Commodore, Atari, and Apple II. This MPU_6502 is an object of MPU_6502 class. All member
0
8987
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
8826
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
9534
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...
1
9316
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
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
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
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
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
3
2211
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.