This week's book giveaways are in the iOS and Features new in Java 8 forums. We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line! See this thread and this one for details.
Originally posted by Paulo Freitas: Are nested Interface classes a good programming practice or is there any other workaround to better address this kind of implementation?
Well, you can always work around this by putting the class outside the interface. Is a class enclosed in an interface good programming practice? Well, this is probably getting close to a religious debate about what is good and what is not good practice. However, my opinion is this: If a class is so tightly coupled with an interface that the interface relies on that class in order to compile (such as returning an object of that class type) AND no other class uses that class outside of the methods defined in that interface - then, maybe it's okay. In case you can't tell from that statement, I find classes enclosed within interfaces to be a bit confusing (not that they're hard to understand, you just don't see them often). So, I tend to shy away from them. So, there's the "wishy washy" answer for the week. :roll: I think it can be acceptable in some cases, but I certainly wouldn't make a common practice of it. Corey