• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Stuff

 
Keith Jones
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys/Gals,

Just a general question. Assume you have about 6 or 7 classes where one (call it X) contains an instance of another which in turn contains an instance of a third and so forth until you get to the last class in the trail (call it Y), is it ok do you think for another class which contains an instance of X to pass values to X (through X's constructor) so that Y can use it even though neither X nor any of the intermediate classes use those values (all they do is pass them on)?
 
Sam Codean
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not!! if that is essential then do it.
I would have preferred a getter method relay (though it would become 6-7 levels deep) to get the handle of Y and then use that instance to perform the task
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is also a question better asked in our Java in General forums...
And please choose a more meaningful topic title in future.
Thanks
[ November 03, 2006: Message edited by: Barry Gaunt ]
 
Keith Jones
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Barry. Consider wrists suitably slapped, will behave accordingly next time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic