473,320 Members | 2,122 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,320 software developers and data experts.

Re: Access 'parent' variables

RichB wrote:
Thanks, i had thought along those lines, but didn't think that it was
very oo as B is not really a part of Object A.
If it isn't really a part of object A, then it shouldn't depend on it
either.

Provide a "validation context" type of object to it instead of a
"parent", so that it can validate itself against the context, not
necessarily the "parent". An interface containing just the needed
properties is a good way to go here.

What happens if you have a B without an A?

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #1
1 1591
Sorry, I had got my As and Bs mixed. B is a part of A, but B also is
dependent on A in it's validation. It was the reference to A in B which did
not seem appropriate to me. What you say below is actually very valid
though.

My structure is actually that B is a part of A and part of another object
(C). So something like this:

A--C--B1
|
B2

In actuality B1 is dependent on the date values in B2 which is the same
class. With this being the case is validation context object the way to go?
I am not however quite sure what is meant by a validation context object,
especially when you add your note about an interface, could you explain this
concept a little more.

My first thoughts are that the validation context is a wrapper (D) to B with
the validation data referenced within it i.e.:

A--C--D--B1
|
B2

But where does the Interface come in, is it just a 'template' for D,
something like:

interface iMinMaxDate
{

DateTime Max{get;set;}
DateTime Min{get;set;}
D objectD{get; set;}

ValidateDateTimes(DateTime min, DateTime max, DateTime dateToValidate)
}

I hope that this makes sense, or have I really confused matters?

Thanks, Richard
"Lasse Vågsæther Karlsen" <la***@vkarlsen.nowrote in message
news:uF**************@TK2MSFTNGP06.phx.gbl...
RichB wrote:
>Thanks, i had thought along those lines, but didn't think that it was
very oo as B is not really a part of Object A.

If it isn't really a part of object A, then it shouldn't depend on it
either.

Provide a "validation context" type of object to it instead of a "parent",
so that it can validate itself against the context, not necessarily the
"parent". An interface containing just the needed properties is a good way
to go here.

What happens if you have a B without an A?

--
Lasse Vågsæther Karlsen
mailto:la***@vkarlsen.no
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
Jun 27 '08 #2

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

Similar topics

1
by: Manuel Canas | last post by:
Hi there, I'm having a hard time figuring out why is this happening. The problem is a couple of variables are not getting properly initialized when I load a FormX from it's parent form. I...
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
2
by: Rob Long | last post by:
Hi there Is there any way to access private variables directly from within a priviliged function? I have a situation where the priviliged function's execution context contains variables of the...
3
by: rick | last post by:
I have a situation where I want to write an extensible class that is capable of saving / restoring properties of classes derived from it. A simplified example is explained as follows;- class A...
9
by: Bart Friederichs | last post by:
Hi, I have an index.html with a frameset with 2 php files. The top frame are buttons, that refresh the lower frame or put different content in it. Some of these pages have javascript-tabs and I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.