Hibernate example uses the Java Reflection to discover fields in our class in order to create the database tables (using the auto-update = ‘true’). Some known examples that use the idea of reflection to make your software extensible are tools like Hibernate, Netbeans, Eclipse and among others that enable new plugins to be installed without changing the application code page. By just adding plugins without messing with any code, it is incredible and extremely powerful. Using Java Reflection in the correct way in our system can become more complex (in terms of features). We consider the extensibility as one of the most important points and beneficiaries of Java Reflection. Some items are pretty obvious, such as the Productivity Gain, because it is clear that we will not need to rewrite code every time we want to add new features to our system, it is obvious that it has to be ready to receive such ” Coupling “. There are also the benefits that can be availed if we use the Java Reflection correctly and appropriately. Exposure of the internal structure of objects: for using this feature we have access to all methods and attributes of the given object, this can be a problem when it comes to security.Problems for security restriction: especially if done in an environment with specific rules. Reduction of Performance: because the code that is being executed is required very often, hence will result in a reduction of performance.This feature should be used with care, always paying attention to the possible risks that can be caused by improper use:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |