INFO 6250 Lecture Notes - Lecture 23: Xml, Init, Java Development Kit

78 views5 pages

Document Summary

The introduction of annotation-based configurations raised the question of whether this approach is "better" than xml. The long answer is that each approach has its pros and cons, and usually it is up to the developer to decide which strategy suits them better. Due to the way they are defined, annotations provide a lot of context in their declaration, leading to shorter and more concise configuration. However, xml excels at wiring up components without touching their source code or recompiling them. Some developers prefer having the wiring close to the source while others argue that annotated classes are no longer pojos and, furthermore, that the configuration becomes decentralized and harder to control. No matter the choice, spring can accommodate both styles and even mix them together. The @required annotation applies to bean property setter methods, as in the following example: public class simplemovielister { private moviefinder moviefinder; @required public void setmoviefinder(moviefinder moviefinder) { this. moviefinder = moviefinder;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers