Презентация Introduction to spring framework and dependency injection онлайн
На нашем сайте вы можете скачать и просмотреть онлайн доклад-презентацию на тему Introduction to spring framework and dependency injection абсолютно бесплатно. Урок-презентация на эту тему содержит всего 31 слайд. Все материалы созданы в программе PowerPoint и имеют формат ppt или же pptx. Материалы и темы для презентаций взяты из открытых источников и загружены их авторами, за качество и достоверность информации в них администрация сайта не отвечает, все права принадлежат их создателям. Если вы нашли то, что искали, отблагодарите авторов - поделитесь ссылкой в социальных сетях, а наш сайт добавьте в закладки.
Презентации » Устройства и комплектующие » Introduction to spring framework and dependency injection
Оцените!
Оцените презентацию от 1 до 5 баллов!
- Тип файла:ppt / pptx (powerpoint)
- Всего слайдов:31 слайд
- Для класса:1,2,3,4,5,6,7,8,9,10,11
- Размер файла:494.00 kB
- Просмотров:74
- Скачиваний:0
- Автор:неизвестен
Слайды и текст к этой презентации:
№2 слайд
Содержание слайда: Spring Framework
A popular and stable Java application framework for enterprise development
Ubiquitous for Java development
Well established in enterprise Java apps
Time tested and proven reliable
A primary purpose is to reduce dependencies and even introduce negative dependencies
Different from almost every other framework out there
Part of the reason it has been adopted so quickly
№5 слайд
Содержание слайда: What does Spring offer?
Dependency Injection
Also known as IoC (Inversion of Control)
Aspect Oriented Programming
Runtime injection-based
Portable Service Abstractions
The rest of spring
ORM, DAO, Web MVC, Web, etc.
Allows access to these without knowing how they actually work
№6 слайд
Содержание слайда: Dependency Injection defined
Method to create needed dependencies or look them up somehow without doing it in the dependent code
Often called Inversion of Control (IoC)
IoC injects needed dependencies into the object instead
Setters or Contructor
Primary goal is reduction of dependencies in code
an excellent goal in any case
This is the central part of Spring
№7 слайд
Содержание слайда: Aspect Oriented Programming defined
Attempts to separate concerns, increase modularity, and decrease redundancy
Separation of Concerns (SoC)
Break up features to minimize overlap
Don’t Repeat Yourself (DRY)
Minimize code duplication
Cross-Cutting Concerns
Program aspects that affect many others (e.g. logging)
AspectJ is the top AOP package
Java like syntax, IDE integration
№8 слайд
Содержание слайда: Portable Service Abstractions defined
Services that easily move between systems without heavy reworking
Ideally easy to run on any system
Abstraction without exposing service dependencies
LDAP access without knowing what LDAP is
Database access without typical JDBC hoops
Basically everything in Spring that is not IoC or AOP
№9 слайд
Содержание слайда: What is a bean?
Typical java bean with a unique id
In spring there are basically two types
Singleton
One instance of the bean created and referenced each time it is requested
Prototype (non-singleton)
New bean created each time
Same as new ClassName()
Beans are normally created by Spring as late as possible
№10 слайд
Содержание слайда: What is a bean definition?
Defines a bean for Spring to manage
Key attributes
class (required): fully qualified java class name
id: the unique identifier for this bean
configuration: (singleton, init-method, etc.)
constructor-arg: arguments to pass to the constructor at creation time
property: arguments to pass to the bean setters at creation time
Collaborators: other beans needed in this bean (a.k.a dependencies), specified in property or constructor-arg
Typically defined in an XML file
№12 слайд
Содержание слайда: What is a bean factory?
Often seen as an ApplicationContext
BeanFactory is not used directly often
ApplicationContext is a complete superset of bean factory methods
Same interface implemented
Offers a richer set of features
Spring uses a BeanFactory to create, manage and locate “beans” which are basically instances of a class
Typical usage is an XML bean factory which allows configuration via XML files
№13 слайд
Содержание слайда: How are beans created?
Beans are created in order based on the dependency graph
Often they are created when the factory loads the definitions
Can override this behavior in bean
<bean class=“className” lazy-init=“true” />
You can also override this in the factory or context but this is not recommended
Spring will instantiate beans in the order required by their dependencies
app scope singleton - eagerly instantiated at container startup
lazy dependency - created when dependent bean created
VERY lazy dependency - created when accessed in code
№14 слайд
Содержание слайда: How are beans injected?
A dependency graph is constructed based on the various bean definitions
Beans are created using constructors (mostly no-arg) or factory methods
Dependencies that were not injected via constructor are then injected using setters
Any dependency that has not been created is created as needed
№15 слайд
Содержание слайда: Multiple bean config files
There are 3 ways to load multiple bean config files (allows for logical division of beans)
Load multiple config files from web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/WEB-INF/spring-config.xml, classpath:/WEB-INF/applicationContext.xml</param-value>
</context-param>
Use the import tag
<import resource="services.xml"/>
Load multiple config files using Resources in the application context constructor
Recommended by the spring team
Not always possible though
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext( new String[] {"applicationContext.xml", "applicationContext-part2.xml"});
№22 слайд
Содержание слайда: AOP in Spring
Provides way to create declarative services and custom aspects
Transaction management is the most common aspect (or concern)
Spring handles AOP via advisors or interceptors
Interception point is a joinpoint
A set of joinpoints are called a pointcut
pointcuts are key to Spring AOP, they allow intercepts without explicit knowledge of the OO hierarchy
Action taken by an interceptor is called advice
№24 слайд
Содержание слайда: Spring AOP key points
Pure java implementation
Allows method interception
No field or property intercepts yet
AOP advice is specified using typical bean definitions
Closely integrates with Spring IoC
Proxy based AOP
J2SE dynamic proxies or CGLIB proxies
Not a replacement for AspectJ
№29 слайд
Содержание слайда: Non-spring version
Involves using new to create needed dependencies
Each class must know about the dependencies that it needs
Singletons have to be created and handed to the classes that need them at the same time or you need a static way to access them (or a framework)
Tightly coupled code structure
Скачать все slide презентации Introduction to spring framework and dependency injection одним архивом:
-
Mathematical functions, characters, and strings. Introduction to Java Programming
-
Spring data. Familiar and consistent programming model for data access
-
OOP with C. Introduction C. Data Types. Variables, expressions, statements. C decision and iteration constructs
-
Создание приложения, используя Spring Framework. Java. (Лекция 23)
-
Analysis and Design of Data Systems. Functional Dependencies and Normalization Theory (Lecture 15)
-
Exception Handling in . NET Framework
-
Spring teplates. Thymeleaf & spring framework
-
Introduction and paradigms. Programming language concepts. (Lecture 1)
-
Spring Framework
-
8. Java Databases and JDBC 1. Introduction to Databases