![]() ![]() You have a very good collection of questions on design patterns Javin. If you feel otherwise please feel free to let me know. So, I would say this abstract class, Interface thingi is non-existent or inconsequential now :) However, these days, the fire-power that computers have (in terms of processing) is many times higher than what it was just even a couple of years ago + JVMs have been optimized over generations. Since at runtime the JVM may have to scan through multiple interfaces to find a method while it needs to scan only one class, an abstract class could have given a marginally better performance when compared to an interface. In the olden days this could've been true for the following reason:Ī Class can extend from only one parent class while it can implement multiple interface. Question like How will you ensure Scalability, high avaibility should be asked on software design part as well.Īctually speaking these days, the difference in performance between an Abstract class and an Interface could be negligible or non-existent. J2EE specific patterns like MVC, ViewResolver patter, Front Controller patter, Service Locator are missing from your list of design pattern question. ![]() ![]() Though decorator, Singleton, Factory are both applicable to Java and J2EE. Hi trgoofi, I have also read this somewhere, but I logic is that abstract class can still participate in static binding by declaring static method but since interface can not have any method implementation all binding will be dynamic.I am still looking for more convincing and detailed reason and let you know if I found it, if you have more convincing logic, please let us know.ĭesign pattern questions are more popular on J2EE interviews rather than in core Java interviews. Can you explain how "abstract class is slightly faster than interface" ? ![]()
0 Comments
Leave a Reply. |