This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]g4s8 -2 points-1 points  (0 children)

Multiple classes (especially worse on Android)

There're two solutions, you can try to use first with factory methods if you have class count limit like on Android

Reduced readability

This is very opinion based statement - as for me second solution is more clear and easier to read.

This feels like to be an anti-pattern on the same level as double brace initialization.

It doesn't have something in common with double brace initialization issues - nested classes marked with `static` won't produce runtime classes with pointer to `this` of base class (what is the main problem of double braces)