some Spring API notes
- Annotations in Spring are the bits of markup with a leading at symbol, kinda like decorators in TypeScript.
- Spring started out as an IoC container.
- Enterprise JavaBeans in Java are not needed for Spring and typically one does Spring without them. The EJBs are heavier, clunkier, other architecture.
- POJO stands for Plain Old Java Object.
- A template method pattern is the basic theme of an architecture implementation, defining the basic behavior of an application at a high level.
- You have to use Maven or Gradle to download Spring stuff.
- Java Database Connectivity (JDBC) is an inferior approach to Spring.
- Spring MVC is a web framework and Spring Data is for access to the database.
- @ResponseBody is for converting a message into an HTML response. If a @Controller is changed into a @RestController you do not explicitly need the @ResponseBody syntax.
- We need a mapping inside of a controller to map a route to a URL. Mappings have a distinction between @GetMapping and @PostMapping for example.
- The pom.xml file (POM being Project Object Model) is the base configuration file in a Maven project.
- A @PathVariable extends a URL/mapping to allow for an id to be handed in for a Get or a Delete as the last bit of a route. If you need a more specific variable with a name in the stuff after the question mark in a URL you may use a @RequestParm for such.
- @ExceptionHandler can return an error message.
- JUnit is the defaut testing framework. Spring Boot, AssertJ, and Hamcrest (anagram of matchers) are rivals. JSONPath is for walking what is in a JSON object and Mockito is for mocking.
- HatEoAS uses JSON with URL links in it. The Richardson Maturity Model (named for a Leonard Richardson) has HatEoAS as the best way to go, better than just REST which is in turn better than just services, not-quite-REST without concern for the HTTP (hypertext transfer protocol) verbs, which is in turn yet better than the swamp of POX (Plain Old XML).
No comments:
Post a Comment