spring study

Dependency Injection

The Inversion of Control(IoC) is a general concept, and it can be expressed in many different way. Dependency Injection is one of concrete exapmle of Inversion of Control.

Let us look at these word, Dependecy Injection, sperately. The dependcy means an association between two class. For example class A is dependet of class B. The second part, injection, means class B will get injected into class by the IoC.

Dependency Injection can happen on the way of passing parameters to the constructor or by post-construcotr using setter.

 

RESTful Services

A key different between a traditional MVC controller and the RESTful web service controller is the way that HTTP response body is created. Rather than relying on a view technology to render the HTML, the RESTful web service controller populates and return a object. The object data will be written directly to the HTTP response as JSON.

 

Reference:

Spring Framework - Overview, tutorialspoint

Building a RESTful Web Service, spring

 

posted @ 2017-10-16 00:32  TonyYPZhang  阅读(291)  评论(0编辑  收藏  举报