PHP programmer wanting to learn Spring

I am a PHP programmer and I want to try building a webapp using Spring framework. The problem is that I am clueless and I don’t know where to start.

What tutorials / books / websites do you suggest I study? What is IoC? Am I using it along with MVC? Which Spring Framework Components should I use? How do you know which to use? Are there webapps built with Spring that I could learn from?

Thank you so much in advance!

PS I used Struts (1) about a year ago.

+2


a source to share


4 answers


I am a PHP programmer and I want to try building a webapp with Spring framework. The problem is, I don’t know and I don’t know where to start.

Start by learning Java and Object Oriented Programming.

What tutorials / books / websites do you use guys offering me to study?

Start with the Sun Java tutorial . Work it all through.

What is IoC?

Inversion of control. More details here .

Am I using it along with MVC?

This choice.



What components should Spring be using?

Start with Controllers and SimpleJDBCTemplate.

How do I know which to use? Here's a webapps built with Spring, what can I learn from?

Get started with Spring MVC step by step .

Thank you so much in advance!

PS I used Struts (1) about a year ago.

Unnecessary.

If you've never written a web application with Java or Spring, I would recommend not starting with it.

Start with JSPs written with JSTL, Servlets, and JDBC. No Spring, No Struts, no MVC framework. You will appreciate the framework if you write a web application or two without them. You cannot use Spring well without knowing it.

+4


a source


IOC (Inversion of Control) is a design pattern / principle for decoupling components. For example, you might have a DAO class that is used by two service classes. But let's say, for example, for a data source for each service class. In this case, you can introduce a DAO class for two service classes with two different data source properties.

ServiceClassA -> uses MyDAO with DataSource = A ServiceClassA -> uses MyDAO with DataSource = B

This link has a good example at the IOC http://www.vaannila.com/spring/spring-ioc-1.html .



There are many components in the Spring framework. You can use MVC, IOC, AOP, JDBC, transaction management, scheduler, etc. The best part is they are all independent. For example, you can use Struts like MVC with Spring IOC and pure JDBC or Spring JDBC or Hibernate. Therefore, what you should use really matters to your project or what your organization follows.

I personally love Gary Mack's Spring Recipes book for Spring Introductions.

+1


a source


Even after working with Spring for quite some time, I still refer to http://www.springbyexample.org/ from time to time. There are many great examples out there, and the documentation is a great resource for working with your preferred Spring methods from JDBC / DAO, to Security, to Spring MVC, and more.

When I first started working with Spring, I just highlighted an example of a pet clinic that I'm sure ships with Spring or maybe Spring MVC. What a nice Spring source code for all projects and also examples are available in SVN .

+1


a source


I'm also a php programmer [mostly], and one book that I found helpful when I was trying to learn Spring was Spring: A Notebook for Developers . Yes you can / probably use IoC with MVC, they will take care of different issues.

0


a source







All Articles