By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,837 Members | 1,665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,837 IT Pros & Developers. It's quick & easy.

how can we create dead objects

P: 1
hello friends i am worried abt how to create the dead objects or how can we identify the dead objects in OO. Can u people please help me
May 16 '07 #1
Share this Question
Share on Google+
5 Replies


DeMan
100+
P: 1,806
Hopefully this thread (no pun intended) will help answer that question
May 16 '07 #2

weaknessforcats
Expert Mod 5K+
P: 9,197
You should not have dead objects.

If you member functions correctly protect the member data, then the object will always be valid. If, however, you have public data or otherwise break encapsulation, or refuse to use contstructors/destructors etc, then you are on your own.
May 16 '07 #3

AdrianH
Expert 100+
P: 1,251
You should not have dead objects.

If you member functions correctly protect the member data, then the object will always be valid. If, however, you have public data or otherwise break encapsulation, or refuse to use contstructors/destructors etc, then you are on your own.
Hey weakness, I think they call something like this a 'bug', whether or not they broke encapsulation. :D


Adrian
May 16 '07 #4

weaknessforcats
Expert Mod 5K+
P: 9,197
Yes, a bug.

Silly of me to not put it so clearly.

Encapsulation, however, does limit the amount of code where the bug could reside.
May 16 '07 #5

AdrianH
Expert 100+
P: 1,251
Yes, a bug.

Silly of me to not put it so clearly.

Encapsulation, however, does limit the amount of code where the bug could reside.
With clarity comes understanding. ;) :D :)


Adrian
May 16 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.