Dustin Schultz dustin.schultz@utah.edu

namibiancurrishInternet and Web Development

Nov 12, 2013 (3 years and 10 months ago)

76 views

Dustin Schultz

dustin.schultz@utah.edu



“Lightweight” Enterprise Java
Development Framework


Helps you with “boilerplate” code
(verbose code to accomplish something
small)


Dependency Injection


don’t call me, I’ll
call you


Promotes loosely coupled development


A container to manage your objects



What does lightweight mean?


Originally it referred to being lightweight as compared to Enterprise
Java Beans (EJB)


Additionally, it refers to how the Spring Framework can be used in
parts


spring
-
core


The core, Dependency Injection, etc


spring
-
jdbc


Java Database Connectivity Support


spring
-
struts


Struts Framework Support


spring
-
web


Web Development Support (JSP, etc)


spring
-
orm


Object Relational Mapping Support (Hibernate, etc)


spring
-
aop


Aspect Oriented Programming Support


spring
-
test


Unit Testing Support


spring
-
oxm


Marshalling/Unmarshalling Support (JAXB, etc)


spring
-
jms


Java Messaging Support


Many more!


Boilerplate code is frequent, verbose, code needed
in order to accomplish something small.


Boilerplate Reduction = Simplification



JDBC is a great example of this


http://
www.vaannila.com/spring/spring
-
jdbc
-
tutorial
-
1.html



Enterprise development involves a lot of
dependencies



This
was originally one of Spring’s large
selling points but Spring is now so much
more
.



Hollywood Principle


Don’t call me, I’ll call
you


A form of Inversion of Control (
IoC
)


You give up control of instantiation/lookup to Spring





Instead of “calling me”


Object

foo

=

FooFactory.
getFoo
()
;



“I’ll call you”


private

Object

foo
;

public

void

setFoo
(
Object

foo
)

{




this
.
foo

=

foo
;

}





ApplicationContext

is a
Object or “Bean”
factory on steroids
.


Instantiates your beans and adds additional
functionality like post processors



Spring
manages your
objects


From instantiation to destruction


You
hardly ever use the ‘new’ keyword
anymore


“Singleton”


Lazy initialization







Goal: build a simple application that says
hello in several languages utilizing Spring



If you use git: git clone
git://git.bmi.utah.edu/swe
-
series/spring
-
intro.git



http://git.bmi.utah.edu/swe
-
series/spring
-
intro/archive
-
tarball/master