How to verify/ check objects for correctness

This is a discussion on How to verify/ check objects for correctness within the Object forums in Theory and Concepts category; Hi, I am a newbie and recently came across this question, which, i am afraid I do not really understand.Following is the problem statement. "A class receives a Request object from outside from a client and cannot be presume to be valid at any given moment. Define how the responsible object should look like." Any recommendations on relevant reference material would be of great help to me in understanding these things. BR /Feraz...

Go Back   Application Development Forum > Theory and Concepts > Object

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 10-27-2008, 09:05 PM
auspicious
Guest
 
Default How to verify/ check objects for correctness

Hi,

I am a newbie and recently came across this question, which, i am
afraid I do not really understand.Following is the problem statement.

"A class receives a Request object from outside from a client and
cannot be presume to be valid at any given moment. Define how the
responsible object should look like."

Any recommendations on relevant reference material would be of great
help to me in understanding these things.

BR
/Feraz
Reply With Quote
  #2  
Old 10-28-2008, 04:19 AM
Dmitry A. Kazakov
Guest
 
Default Re: How to verify/ check objects for correctness

On Mon, 27 Oct 2008 18:05:26 -0700 (PDT), auspicious wrote:

> "A class receives a Request object from outside from a client and
> cannot be presume to be valid at any given moment. Define how the
> responsible object should look like."
>
> Any recommendations on relevant reference material would be of great
> help to me in understanding these things.


In short: scrap the design.

Any object is valid when accessible. That's per definition. How access can
be limited (blocked, delayed etc) in order to ensure consistency of
objects, or not limited (lock-free approaches) is another story.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
Reply With Quote
  #3  
Old 10-28-2008, 11:23 AM
H. S. Lahman
Guest
 
Default Re: How to verify/ check objects for correctness

Responding to auspicious...

> "A class receives a Request object from outside from a client and
> cannot be presume to be valid at any given moment. Define how the
> responsible object should look like."


This homework problem is pretty ambiguous. Get the instructor to clarify
whether the "responsible object" is the Request, the object receiving
the Request, the client, or some other designated arbiter of validity.

You might also ask the instructor why the client is forwarding invalid
objects. Then google "Design by Contract".


--
There is nothing wrong with me that could
not be cured by a capful of Drano.

H. S. Lahman
hsl@pathfindermda.com
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@pathfindermda.com for your copy.
Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
Reply With Quote
  #4  
Old 10-29-2008, 05:56 AM
Nick Keighley
Guest
 
Default Re: How to verify/ check objects for correctness

On 28 Oct, 01:05, auspicious <auspicious...@gmail.com> wrote:

> I am a newbie and recently came across this question, which, i am
> afraid I do not really understand.Following is the problem statement.
>
> "A class receives a Request object from outside from a client and
> cannot be presume to be valid at any given moment. Define how the
> responsible object should look like."
>
> Any recommendations on relevant reference material would be of great
> help to me in understanding these things.


I suppose the Client could be some sort of external untrusted system.
And a Request is some sort of message, perhaps a stream of bytes.
All I can this is that AClass validates the potential Request.
If its invalid it rejects it. If its valid it constructs a Request
from the byte stream and processes the Request. I don't understand
what "Cannot be presumed to be valid at any given moment". Can
it become invalid after I've run my validation code? In general
I don't think this is solvable.

--
Nick Keighley

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:54 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.