Sie sind auf Seite 1von 27

Spring introduction

Spring

C, C++ ,java, C# and etc.. programming languages


JDBC , Servlet , JSP, EJB,JTA , JNDI and etc ... Java Technologies
struts, spring, hibernate , JSF and etc.. java frameworks
Programming languages

Raw materials providing basic features for application development.


Defines the syntaxes (rules), semantics (structure) of programming by supplying compilers,
interpreters.
Base to create technologies, frameworks, DB s/WS, Tools, Operating systems and etc.
Software Technologies
It is software specification providing rules and guidelines to develop software by using one or another
programming language.
Technology is not installable, but technology s/w is installable or arrnagable.eg: Jdbc technology gives
rules and guidelines to develop JDBC driver s/WS using java language.
Every technology gives API in the form

Packages API interfaces ----> rules


Classes ----> guidelines
abstract class ---> rules and guidelines
java 8 interfaces --->rules and guidelines (default methods)

There are two types of software technologies

Open Technologies

Here rules and guidelines of technology are open to multiple software companies to create softwares.
eg: All Java technologies like JDBC, Servlet, JSP and etc..

Proprietary Technologies

Here the vendor who has created Technology, is only allowed to create Technology based software.
e.g.: All Microsoft technologies like asp.net and etc..
Frameworks

It is a installable software that is built on the top of one or more technologies having ability to generate
the common logics of the application dynamically.
It is a special installable software that provides abstraction layer on one or more technologies to
simplify the application development process.
While working with technologies we need to develop both common and uncommon logics.
While working with frameworks we just need to develop application specific logics.
Frameworks internally uses technologies but they never make programmer to worry about it(This is
nothing but hiding technologies that are used, which also called providing abstraction layer) e.g.:
struts, spring, hibernate and etc..

=>Middleware services: --->Secondary Logics ----> Aspects


|---->These are additional and optional logics/services that can be applied applications to make them more
perfect and accurate.
|--->These are not minimum logics of application development, These are optional and configurable logics
|--->e.g.: Security, Auditing, Logging and etc.
Evaluation of spring

1995 -----------------------------> Applets ------ ( For gaming )

1996 -------------------------------->Java Beans + Java classes


(Business Logics/Service logics)
Advantages
a) Light weight
b) Easy to develop
Disadvantages
a) Does not allow remote clients
b) does not allow to apply middleware services

1998 ----------------------------------->EJB (Enterprise Java Beans)


Advantages
a) Allows both local and remote clients
b) Allows to use apply middleware services
Disadvantages
a) Heavy weight
b) Complex to learn and use

2003 ------------------------>Spring
Advantages
a) Development using ordinary classes and interfaces
b) Non-Invasive
c) Middleware service on ordinary classes
d) Lightweight
e) Robust ---> Allows to develop diff types of logics and Applications and etc...

Q-1 : Is Spring alternate to EJB?


Ans ) no
Q-2 : Is Spring Alternate to Struts?
Ans ) no
Q-3 : Is Spring Alternate to JSE,JEE?
Ans) no
Spring 1.x 7 Modules
Spring 2.x 6 Modules
Spring 3.x & 4.x 7 Modules
Spring 1.x Overview Diagram

Spring Core
Base module for other modules

When it is used alone , we can develop core java style standalone application

Gives two container A) Beanfactory B) ApplicationContext

Spring Containers are given to perform dependency management

Dependency management means creating both main and dependent classes and assigning dependent

object to main object dynamically.


Container is s/w application that manages the whole life cycle of given resource (class) (birth to

deathobject creation to destruction)

Spring container are not alter net of Servlet, JSP Container.

Spring DAO/Spring JDBC


Provide abstraction layer on plain JDBC and simplifies JDBC style SQL query based persistence logic
development.
Convert JDBC specific SQLException (Checked) to unchecked SQLException and its sub classes.
Gives lots of sub classes for DataAccessException on one class per each problem basis.

Spring ORM
Plain JDBC, Spring JDBC persistence logic is not portable across the multiple DB S/w because of SQL
Queries. To overcome from this problem use ORM frameworks to develop the object based (no SQL
Queries) DB s/w independent persistence logic. E.g. Hibernate, iBatis,OJB and etc.
Spring ORM is not an ORM framework. It is a module of spring framework providing abstraction layer on
multiple ORM framework to simplify object based persistence logic development.

Spring Web
Supplies plugin to make web framework apps like struts, JSF, Web Work and etc. application
interacting with spring application. Useful for following integration
Struts-------------Spring , JSF---------------Spring and etc.
Spring Web MVC/spring MVC
Springss own framework to develop MVC architecture based web application. It is AlterNet to
JSF, Struts and etc frameworks.
Spring Context
Provide abstraction layer on multiple JSE,JEE technology like JNDI,RMI,EJB,java mail, JTA and
etctechnologies and simplifies their application development. The biggest module spring but
not so popularly used module.
Spring AOP(Aspect Oriented Programming )
AOP is not replacement to OOP.AOP compliments OOP.

Problem: (with OOP programming)


Spring 2.X Overview Diagram

Das könnte Ihnen auch gefallen