I have an application that uses provider pattern, the application uses the provider implementation by calling interface defined by the application .
I am currently researching the methods from which I can customize my application around the interface calls.
I can limit the complexity of my application to:
- I need to load the implementation dynamically once upon startup
- I need a provider implementation for a particular group of interfaces for any application frequency at any one time.
I appreciate those who are employed in any strategy:
- Reducing the interface calls
- Any Move the interface directly to the interface implementation sections.
- Different ways to better take advantage of a compiler optimization.
Thank you!
Some misconceptions
-
You can reduce the interface call by calling the underlying solid implementation directly (or using the intangible classes) when you make it simpler and improve the maintenance (usually More interface helps, but not always)
You can enter an interface reference for a solid reference and instead you can use it instead. This is generally poor programming practice and has very little effect on its performance. Generally, you only do this when refactoring works well over its value (this is not a good design approach but can be practical one).
The compiler does not optimize the code in any important way Some optimizations do this (like inlineing to compile time constants) Probably you can do without JVM Runtime usefully optimizes Others estimate what JVM will do and trying to optimize their code is a mark and error process. If you have 10 things that you think should help, make 1 very fast, 6 will make a difference, and 3 will slow down. That means simple code can be customized.
Unlike C ++, most JVMs can optimize the cost of virtual tasks, when there are actually only one or two implementations i.e. to determine the compiler steadily Instead, you can customize the code based on how it is used.
-
Comments
Post a Comment