473,466 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question regarding oo design / layers

Hi all,

Ok - I have a few objects I've created, some live in my dal, some in my bol
and some in my ui...

Here's the thing - I have the need to persist an ID which is used for
display purposes only (control ID) and the only place I can persist this is
in one of my objects (session variables are not acceptable)....the problem
is - the object which it would most likely go in belongs in my bol...to me
this feels wrong, oh so very wrong, as my understanding, whilst limited is
that objects in my bol should not know about ui things equally not know
about dal things...

So, here's the question - would it be more appropriate to have a UI object
specifically created and form part of my bol object as opposed to just
having a class variables in bol object?

Example...

bol object

Resource object

private _displayControlID as guid
OR

Control object

private _controlID as guid

and then have

Resource Object

Private _controlObject as ControlObject

Does the above make any sense? Hope so - not easy to explain and didn't want
to write mammoth amounts of code to explain it...any advice would be
appreciated..

Regards

Rob
Jun 21 '07 #1
2 1137
I don't know if this is any help, but we usually create UI objects that hold
the sort of thing that you're talking about, if I understand you correctly.
We store references to them in the Session. The data in these objects
reflects their state resulting from user input or other UI-specific things
(like default display values and so on). This data is validated as
appropriate, and has the appropriate business rules applied each time the
user leaves a page (or saves the data). It is at this point that the data
is passed from the UI layer to the business layer: and obviously we only
pass the data that we need at the BOL and DAL levels.

HTH
Peter

"Rob Meade" <ku***************@edaem.borwrote in message
news:uR*************@TK2MSFTNGP04.phx.gbl...
Hi all,

Ok - I have a few objects I've created, some live in my dal, some in my
bol and some in my ui...

Here's the thing - I have the need to persist an ID which is used for
display purposes only (control ID) and the only place I can persist this
is in one of my objects (session variables are not acceptable)....the
problem is - the object which it would most likely go in belongs in my
bol...to me this feels wrong, oh so very wrong, as my understanding,
whilst limited is that objects in my bol should not know about ui things
equally not know about dal things...

So, here's the question - would it be more appropriate to have a UI object
specifically created and form part of my bol object as opposed to just
having a class variables in bol object?

Example...

bol object

Resource object

private _displayControlID as guid
OR

Control object

private _controlID as guid

and then have

Resource Object

Private _controlObject as ControlObject

Does the above make any sense? Hope so - not easy to explain and didn't
want to write mammoth amounts of code to explain it...any advice would be
appreciated..

Regards

Rob

Jun 21 '07 #2
"Peter Bradley" wrote ...
>I don't know if this is any help, but we usually create UI objects that
hold the sort of thing that you're talking about, if I understand you
correctly. We store references to them in the Session. The data in these
objects reflects their state resulting from user input or other UI-specific
things (like default display values and so on). This data is validated as
appropriate, and has the appropriate business rules applied each time the
user leaves a page (or saves the data). It is at this point that the data
is passed from the UI layer to the business layer: and obviously we only
pass the data that we need at the BOL and DAL levels.
Hello Peter,

Thank you for your reply.

That makes sense to me I think, and I think it will fit with my current
project - just to run it past you in more depth...

I have a registration process with three stages, the third stage the user
selects "resources" which they require access to, this is done via a link on
the page which launches a popup window listing all available resources.
When the user selects one a little bit of a javascript populates a hidden
element on the parent page and fires a Click() event on a hidden button on
the parent page. Ajax then enables me to perform an asynchronous postback -
and this is where the magic happens!

I populate a "Resource" object, and using the ResourceID get the available
Access Levels for it.

The ResourceName is displayed on the page, underneath a drop down list
containing all of the AccessLevels, a second drop down box is also
displayed, this is populated again using Ajax when the user selects an
AccessLevel.

Because the user can add as many Resources as they wish the page builds up
with these controls, the problem I have run into is that I need the ability
to give it collection of bits a unique ID - and persist it. I am unable to
use the ResourceID as they can select the same resource more than once (by
design), therefore I want to create a GUID but store it.

If I was to create a UI object, and part of that object stores the GUID and
another part stores my Resource, AccessLevel choice, Parameter (second drop
down) choice - would this still *fit* the OO / Layers rules?

A screenshot of the page in question can be seen here:
<http://www.avon.nhs.uk/RobsToGo/ScreenShot.jpg>

Any further information would be appreciated.

Regards

Rob
Jun 22 '07 #3

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

Similar topics

2
by: Jo_Calico | last post by:
I love the Dynamic Drive cross browser marquee script. I'd like to make the text loop immediately after completion, so the beginning runs right after the end (does that make sense?). Could anyone...
2
by: Mark Preston | last post by:
Its perhaps a bit early to ask, since I'm still doing the page design and haven't got down to the coding yet, but I wonder if anyone can help with a bit of a question. To lay the groundwork, a...
3
by: Simon Harvey | last post by:
Hi everyone, I am in the process of making a small application and in the process of designing and implementing it, I have come accross a sort of general design related question. I'm using...
2
by: mrpubnight | last post by:
Hello everyone I'm hoping someone with more experience can suggest how I would go about designing the following: We have a standard web application and in its current form there are no distinct...
2
by: russell.lane | last post by:
I'm building out a pretty standard n-tier web application. The stack includes application/presentation, biz logic, and data access layers on top of an SQL server back end. We want to use...
4
by: Maciek | last post by:
I've got this question regarding programming and design practices. I'm designing Newsletter module for my WebApp and I'm greenhorn in programming. There's a stored procedure which adds a...
3
by: CSharpguy | last post by:
I have a 03 .NET web that does not use Typed DataSets, it uses a Busines Layer/DataLayer classes. Alot of my reading on .NET 05 is using the DataSets for the datalayer/business layer. I have a 05...
1
by: Griff | last post by:
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...
15
by: nikki_herring | last post by:
I am using setTimeout( ) to continuously call a function that randomly rotates/displays 2 images on a page. The part I need help with is the second image should rotate 3 seconds after the first...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.