For my project, i choose to using reflection to find all class in pkg coolection that implement the specified interface.
example like reflection.getSubTypeOf(MyClassInterface.class);
MyClassInterface is like plugin
concept.
Then the reflection will search through the pkg to find the class who implement this plugin
.
It's work, but is slow during i doing the deployment. Here the disadvantage, when my project is growing huge, the reflection of searching will make the project deployment slow.
Any other way is better than using reflection ? i do search about something like lambdaMetaFactory to replace it.
Aucun commentaire:
Enregistrer un commentaire