Quantcast
Viewing all articles
Browse latest Browse all 5648

Singleton for empty models

While I have re-usable panels, I don't want them to look up the component
tree hirarchy for a compound property model.

So I end up creating a lot of empty models such as:

super(id, new Model());

How do you guys manage your empty models?

Won't it make sense to have a Model.EMPTY_INSTANCE or similar?

Of course I can have Spring or some other DI handle that empty instance as
a singleton, but I am curious as to how other users solve this problem?

Viewing all articles
Browse latest Browse all 5648

Trending Articles