Narrator: Hey, in this video, 2 2
I'm going to give you an overview of the Spring Framework. 3 3
So, first off, here's the official website for Spring. 4 4
It's at www.spring.io. 5 5
So, this is where you can get 6 6
all the documentation for Spring, 7 7
you can download Spring, you can look at some tutorials 8 8
and also some getting started guides, 9 9
and we'll use this website a lot during this course. 10 10
So, why Spring? 11 11
And I covered this in the last video, but again, 12 12
in a nutshell, it's to simplify Java Enterprise Development, 13 13
make it much simpler than what we had 14 14
in J2EE or Java EE, 15 15
and I gave all the pros and cons for that 16 16
in the previous video. 17 17
So, here, let's kind of drill down a bit 18 18
and talk about the goals of Spring, like what are the goals. 19 19
Well, first off, lightweight development with Java POJOs, 20 20
and POJOs mean Plain Old Java Objects, 21 21
make it much simpler to build, 22 22
as compared to the heavyweight EJBs 23 23
from the early versions of J2EE. 24 24
And then also, we want to promote loose coupling 25 25
by making use of dependency injection. 26 26
So instead of hard wiring your objects together, 27 27
you simply specify the wiring via a configuration file 28 28
or annotations, and we'll cover that a lot in this course. 29 29
Then the next idea is declarative programming 30 30
with Aspect Oriented Programming, or AOP. 31 31
This'll basically allow you to add 32 32
some applicationwide services to your given objects. 33 33
And then finally, the main thing here 34 34
is to minimize boilerplate Java code. 35 35
So in the early days of J2EE, there was a lot of code 36 36
that you had to write, and so the folks at Spring, 37 37
they created a collection of helper classes 38 38
to make it easier, 39 39
and again, to minimize all of the boilerplate code, 40 40
and we'll see some examples of that 41 41
a little later in the course. 42 42
Now, this is kind of a big picture here, 43 43
of the Spring Framework and this is kind of 44 44
like the core Framework. 45 45
And what I'll do is I'll actually 46 46
go through these various sections here 47 47
and just give you a quick overview, 48 48
as far as what they're about. 49 49
Alright, so let's go ahead and start here 50 50
with the Core Container. 51 51
So the Core Container's like the heartthrob, the main, 52 52
I guess, the main item here of Spring. 53 53
So basically, it manages how Beans are created. 54 54
It has a Bean factory for creating the Beans. 55 55
It basically can reconfig. files 56 56
for setting properties, independencies 57 57
and also the Context here's really the Spring Container 58 58
that holds the Beans in memory. 59 59
And then there's SpEL, 60 60
that's for the Spring Expression Language, 61 61
so it's a little language we can use 62 62
within the config. files to refer to other Beans, 63 63
and we'll see example of that later. 64 64
But that's kind of the Core Container, 65 65
for creating Beans and then making those Beans available. 66 66
So let's move over to the AOP section. 67 67
So this is where you have support 68 68
for Aspect Oriented Programming. 69 69
So basically, what AOP, in a nutshell, 70 70
it allows you to create these applicationwide services, 71 71
like logging, security, transactions, instrumentation 72 72
and then you can apply these services to your objects 73 73
in a declarative fashion, so no need to modify your code 74 74
to have support for this. 75 75
You simply add a config. in the config. file 76 76
or an annotation, 77 77
and that service will be applied to your application. 78 78
And we'll see examples of this, 79 79
primarily when we get into some transaction work, 80 80
but some other areas too we'll play around with it a bit. 81 81
So then, moving forward here, 82 82
let's take a look at the Data Access section or integration. 83 83
So basically, here, this is for communicating 84 84
with the database, either a relational database 85 85
or a NoSQL database. 86 86
And also, making use of, like, a message queue. 87 87
So on the top left, you have JDBC. 88 88
Basically, Spring provides some helper classes 89 89
to make it much easier to access a database, using JDBC. 90 90
And, by using these Spring JDBC classes, 91 91
you can actually reduce your source code by over 50%, 92 92
so a lot of good helper classes there. 93 93
The next little bullet there is ORM, 94 94
for Object to Relational Mapping. 95 95
This is probably the most popular section 96 96
of this module, here. 97 97
Basically, it allows you to hook into Hibernate, 98 98
or hook into JPAs. 99 99
A lot of support and a lot of synergy 100 100
between Spring and Hibernate.