Null Object
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Felker_Robert
Posted On:   Monday, July 16, 2001 06:34 AM

Does a final static nullObject is preferable to null pointer ? why ?

Thanks for your light :)

Re: Null Object

Posted By:   Steven_Martin  
Posted On:   Monday, July 16, 2001 06:51 AM

I would never recommend making a nullObject as a datamember. Relying on a object to be null or not is also dangerous.

I recommend the following:

1. construct a version of the object that will throw a specific exception if its not initialized.

2. if you must, use x==null
About | Sitemap | Contact