[Yact-dev] Null object
Status: Pre-Alpha
Brought to you by:
basic
|
From: Marius S. <ma...@fi...> - 2000-03-14 04:59:21
|
I think we should add a YNullable interface (or similar):
class YNullable
{
bool isNullObject() = 0;
}
Let's get rid of as many "if pointer is not null" statements as
possible. I think this will make Yact a lot more stable (the risk of
coredumping is greatly reduced) and code-flow in general will be much
cleaner, prettier, and easier to read. No more of those annoying null
pointer if's, and just go ahead and access the object directly. If null
pointer have some meaning that makes them different from an object, then
use isNullObject(), where null classes return true, and other classes
return false.
You can already get Yact to crash by playing around with adding new classes
and adding inheritance and deleting them etc. I don't know where the bug
is exactly, but I bet it's a null pointer.
- Marius
|