Javabeans & Tags are useful in JSP as they encapsulate

[nz_btn text="Software Resiliency" link="http://casthighlight.wpengine.com/software-resiliency/" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill" icon="icon-dashboard"][nz_btn text="Programming Best Practices" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="screen" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-resiliency/programming-best-practices/" icon="icon-code"]

Why you should care

It is recommended to use Javabeans and tags as Java Beans are good general-purpose objects that encapsulate information and states in a portable setting while allowing for its’ properties, events and methods can be controlled as they are exposed to an application builder tool. JSP tags are also useful as they encapsulate reusable functionality on JSP pages. They provide a great way for the logic behind common and recurring tasks to be wrapped up in an easy – to – use package. Beans and tags help in encapsulating code as that helps in code readability, maintainability, efficiency and bug prevention.

Business Impacts

JavaBeans and JSP Tags are useful as they are less risky to use and more productive in the long run. They are designed to help the code be more readable, maintainable and efficient. [nz_btn text="Production Risk" target="_self" animate="false" animation_type="ghost" color="pink" size="small" shape="rounded" type="normal" hover_normal="opacity" hover_ghost="fill" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/risk/" icon="icon-office"]

CAST Recommendations

References

http://www.java-samples.com/showtutorial.php?tutorialid=607[nz_btn text="Style Guide" target="_self" animate="false" animation_type="ghost" color="turquoise" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill" link="https://github.com/Kristories/awesome-guidelines" icon="icon-book"]

How we detect

This code insight shows that javabeans and tags are good-general purpose objects so that the code is more readable and maintainable. When a jsp file uses lot of java code, these codes should be externalized and not embedded. They are used through javaBeans or tag libs afterwards.

About CAST and Highlight’s Code Insights

Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.
[nz_btn text="See features" link="http://casthighlight.wpengine.com/outputs-analytics/" target="_self" icon="icon-stats" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill"][nz_btn text="How it works" link="http://casthighlight.wpengine.com/how-it-works/" target="_self" icon="icon-cog" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill"]
For reference only. For the complete details please refer the original article
https://doc.casthighlight.com/alt_toomanyjavacode-use-beans-and-tags/
Have more questions? Submit a request

Comments

Powered by Zendesk