This document provides an overview of the Spring framework. Some key points:
- Spring promotes loose coupling and separation of concerns through its lightweight container and use of dependency injection.
- It simplifies configuration for aspects like transactions through declarative programming without needing full J2EE.
- The inversion of control container resolves and "injects" dependencies into components.
- Spring supports aspects through its aspect-oriented programming features which allow cross-cutting concerns to be implemented as aspects.
- It provides transaction management, DAO support, and metadata support to further simplify programming tasks.
this ppt tells you about what is spring in java. how to use spring? and what are the main methods of spring class? For more info and free java projects visit : http://s4al.com/category/study-java/
This ppt tells about spring class in java. what spring class have, all the methods in brief. for more info please visit : http://s4al.com/category/study-java/
This document provides an overview of the Spring framework. Key points include:
- Spring is a lightweight container that promotes loose coupling and separation of concerns through dependency injection.
- It simplifies programming without J2EE by providing declarative transaction management and abstraction from underlying technologies.
- Spring uses dependency injection and inversion of control to configure and wire together components. It supports setter, constructor, and autowiring of dependencies.
- The Spring container manages the lifecycle of beans through initialization and destruction callbacks.
Spring Certification Questions and Spring Free test are tests created to demonstrate all the functions of our mock exams. You will be able to access ten full questions and will have ten minutes of time for finishing the test.
There are several components you can interact with when you take our mock exams:
Take a look at the progress bar at the top; it will tell how you are progressing through the exam.
Read the question and select only the answers you think are correct by checking the corresponding check box.
Navigate the spring questions using the "Previous" and "Next" buttons.
Mark the spring questions you wish to review later. All the questions you have marked will be listed on the right in the section "marked questions". You will be able to jump directly to the question from this list.
If you want to take a look at the correct answers for a question, just click the "Solution" button. In the solution section you will be able to check your answers as well as find a full explanation of the question.
Keep an eye on the countdown. This will tell you how much time is remaining. When the countdown expires, the test will be automatically submitted.
Once the test is submitted, the "result" section will expand. Here, you will be able to review all the questions of the test. From here, you can also navigate directly to each question.
The document discusses key concepts related to deploying EJB middleware technologies, including deployment descriptors, access control entries, control descriptors, session descriptors, entity descriptors, and other deployment considerations. The deployment descriptor class is used to communicate information from the developer to the deployer and container. It includes methods to get and set properties like the bean name, security roles, transaction attributes, and more.
Java Annotation is quite a handy tool and has the ample potential to make developer's life a lot easier(and exciting!). Learning and using custom Java Annotation Processor takes the power of Annotation even a class higher. This slide goes over a few fundamental things of an Annotation Processor to get someone started to write his/her own Annotation Processor in Java.
Key topics are,
- Java Annotation
- Usage of Annotation
- Custom Java Annotation
- Java Annotation Processor
- Usefulness of Annotation Processor
- Dive into the core of Annotation Processor
- Solve a validation problem with Custom Annotation Processor
- Get to know some exciting Annotation Processing tools that already exist
The document discusses various ways that EJB clients can access and interact with EJB beans, including:
1) An EJB bean acting as a client to another bean by looking up the bean's home interface and invoking methods.
2) Serializing a handle to a bean so the reference can be stored and used later to access the bean.
3) Clients managing transactions across multiple bean invocations using the UserTransaction interface.
4) Clients authenticating with the EJB server by passing principal and credential properties.
This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, Rossen Stoyanchev will show attendees how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action and learn how you can get involved in the Spring MVC Test Support project.
this ppt tells you about what is spring in java. how to use spring? and what are the main methods of spring class? For more info and free java projects visit : http://s4al.com/category/study-java/
This ppt tells about spring class in java. what spring class have, all the methods in brief. for more info please visit : http://s4al.com/category/study-java/
This document provides an overview of the Spring framework. Key points include:
- Spring is a lightweight container that promotes loose coupling and separation of concerns through dependency injection.
- It simplifies programming without J2EE by providing declarative transaction management and abstraction from underlying technologies.
- Spring uses dependency injection and inversion of control to configure and wire together components. It supports setter, constructor, and autowiring of dependencies.
- The Spring container manages the lifecycle of beans through initialization and destruction callbacks.
Spring Certification Questions and Spring Free test are tests created to demonstrate all the functions of our mock exams. You will be able to access ten full questions and will have ten minutes of time for finishing the test.
There are several components you can interact with when you take our mock exams:
Take a look at the progress bar at the top; it will tell how you are progressing through the exam.
Read the question and select only the answers you think are correct by checking the corresponding check box.
Navigate the spring questions using the "Previous" and "Next" buttons.
Mark the spring questions you wish to review later. All the questions you have marked will be listed on the right in the section "marked questions". You will be able to jump directly to the question from this list.
If you want to take a look at the correct answers for a question, just click the "Solution" button. In the solution section you will be able to check your answers as well as find a full explanation of the question.
Keep an eye on the countdown. This will tell you how much time is remaining. When the countdown expires, the test will be automatically submitted.
Once the test is submitted, the "result" section will expand. Here, you will be able to review all the questions of the test. From here, you can also navigate directly to each question.
The document discusses key concepts related to deploying EJB middleware technologies, including deployment descriptors, access control entries, control descriptors, session descriptors, entity descriptors, and other deployment considerations. The deployment descriptor class is used to communicate information from the developer to the deployer and container. It includes methods to get and set properties like the bean name, security roles, transaction attributes, and more.
Java Annotation is quite a handy tool and has the ample potential to make developer's life a lot easier(and exciting!). Learning and using custom Java Annotation Processor takes the power of Annotation even a class higher. This slide goes over a few fundamental things of an Annotation Processor to get someone started to write his/her own Annotation Processor in Java.
Key topics are,
- Java Annotation
- Usage of Annotation
- Custom Java Annotation
- Java Annotation Processor
- Usefulness of Annotation Processor
- Dive into the core of Annotation Processor
- Solve a validation problem with Custom Annotation Processor
- Get to know some exciting Annotation Processing tools that already exist
The document discusses various ways that EJB clients can access and interact with EJB beans, including:
1) An EJB bean acting as a client to another bean by looking up the bean's home interface and invoking methods.
2) Serializing a handle to a bean so the reference can be stored and used later to access the bean.
3) Clients managing transactions across multiple bean invocations using the UserTransaction interface.
4) Clients authenticating with the EJB server by passing principal and credential properties.
This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, Rossen Stoyanchev will show attendees how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action and learn how you can get involved in the Spring MVC Test Support project.
Spring 3.1 introduces several eagerly awaited features including bean definition profiles (a.k.a., environment-specific beans), enhanced Java-based application and infrastructure configuration (a la XML namespaces), a new cache abstraction, and MVC improvements. This session will provide attendees an in-depth look at these major new features as well as an overview of additional enhancements to the framework such as the new c: namespace for constructor arguments, updates regarding Servlet 3.0, and improvements to Spring's integration testing support.
In this session I have described the different types of dependency injections and their usages.
Reference Link : http://en.wikipedia.org/wiki/Dependency_injection
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
This 50 minutes talk covers the novelties of Java EE 7 (easier to understand if you already know Java EE 6). It comes from the talk I gave with Arun Gupta at JavaOne 2013
JPA and Hibernate are specifications and frameworks for object-relational mapping (ORM) in Java. JPA is a specification for ORM that is vendor-neutral, while Hibernate is an open-source implementation of JPA. Both use annotations to map Java classes to database tables. JPA queries use JPAQL while Hibernate supports both JPAQL and its own HQL. Additional features covered include relationships, inheritance mapping strategies, custom types, and querying.
This document provides an overview of new features in Java EE 6, as presented by Antonio Goncalves. It discusses several major new concepts, including profiles, pruning of specifications, portable JNDI names, managed beans, and interceptors. It also summarizes new features for various specifications, such as JPA 2.0 adding richer mappings and criteria queries, EJB 3.1 introducing asynchronous calls and timers, Servlet 3.0 focusing on ease of development and pluggability, and JSF 2.0 making Facelets the preferred view definition language. The document aims to give attendees an understanding of the key changes and improvements in Java EE 6.
Carol McDonald discusses the key themes and technologies in Java EE 6, which was released on December 10, 2009. The major themes of Java EE 6 are right-sizing with modular profiles, extensibility through pluggability, and ease of development through features like dependency injection and managed beans. New and updated specifications in Java EE 6 include CDI 1.0, EJB 3.1, JPA 2.0, JSF 2.0, JAX-RS 1.1, and Servlet 3.0.
This document discusses new features and improvements in Spring 4. It covers Java 8 support including lambda expressions, date/time API updates, and optional types. It also summarizes core container improvements like meta annotations, generic qualifiers, and conditional bean configuration. General web improvements involving the @RestController annotation and Jackson serialization views are outlined. Testing improvements such as active profile resolution and the SocketUtils class are also mentioned.
Introduction to JPA and Hibernate including examplesecosio GmbH
In this talk, held as part of the Web Engineering lecture series at Vienna University of Technology, we introduce the main concepts of Java Persistence API (JPA) and Hibernate.
The first part of the presentation introduces the main principles of JDBC and outlines the major drawbacks of JDBC-based implementations. We then further outline the fundamental principles behind the concept of object relation mapping (ORM) and finally introduce JPA and Hibernate.
The lecture is accompanied by practical examples, which are available on GitHub.
Annotation processing allows for metadata to be added to Java programs without altering the program itself. Annotations can be defined and used to provide information for compilers or allow runtime/compile-time processing. Annotation processors provide a hook into the Java compilation process to generate source code and compile errors/warnings. They work by processing annotated elements in rounds. Testing annotation processors is challenging but libraries like Google's compile-testing library can help. Annotation processing also works on Android by setting up the processor as a Java module and using plugins like android-apt.
This session describes the overview on different types of spring containers. Here we can also find simple examples showing the demo to instantiate the containers.
Dependency injection (DI) with Spring allows defining beans and their dependencies in code rather than XML configuration files. Spring supports DI through its bean factory and container. Beans can be defined through XML configuration or Java configuration using annotations. The Spring container handles injecting dependencies and calling lifecycle methods like @PostConstruct. This allows loose coupling between classes and testability through dependency injection.
Crack your Java interview by knowing all the questions that your interviewer may ask. Brush up your knowledge with this superb set of Java interview questions & answers prepared by BestOnlineTrainers
The document discusses using Hibernate, an object-relational mapping framework, to provide object persistence and retrieval by mapping Java objects to database tables. It explains what Hibernate does, its features like object-relational mapping and transaction management, and provides examples of persisting and retrieving objects using Hibernate's API. The document also shows how to configure a Hibernate project and map classes and associations between objects and database tables.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
Dependency injection with Spring allows managing object dependencies and compositions. It handles composing objects by externalizing the lookup and assembly of collaborating objects. This avoids tight coupling. Spring supports dependency injection through XML configuration, annotations, and Java configuration. It handles creating and assembling objects and their dependencies. Dependency injection improves testability and maintainability of applications.
The document discusses improvements to caching in Spring 4.1, including support for JSR-107 annotations. Some key points:
- Spring now supports JCache (JSR-107) annotations like @CacheResult, which maps to Spring's @Cacheable.
- Examples show how to rewrite Spring caching code to use JSR-107 annotations, including customizing cache names and keys.
- Support for caching exceptions, cache resolvers, and default caching configurations are described.
- Enabling JSR-107 support requires adding the JCache API and spring-context-support dependencies.
BEA Weblogic Interview Questions And Answers provides a guide to preparing for a BEA Weblogic job interview. It includes sample questions and answers about BEA Weblogic, such as what BEA Weblogic is, why polymorphic responses are not allowed from create() or find() methods in EJBs, and how to set up the CLASSPATH correctly. The document provides explanations and recommendations for various BEA Weblogic concepts and configuration issues.
Java EE 7 will focus on enabling Java EE applications and services to easily operate in public and private cloud environments. Key areas of focus include improved packaging for cloud deployment, tighter resource management, and potential new APIs for cloud services. Modularity enhancements based on Java SE 8 modules will allow applications to be composed of independent, versioned modules. The first Java EE 7 specifications have already been approved.
This document provides an overview and comparison of several popular Java web frameworks: JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket. It introduces the speaker and outlines the agenda, which includes an introduction, pros and cons analysis, framework "smackdown" based on evaluation criteria, and a question and answer session. The speaker's experience with each framework is also shared.
Spring 3.1 introduces several eagerly awaited features including bean definition profiles (a.k.a., environment-specific beans), enhanced Java-based application and infrastructure configuration (a la XML namespaces), a new cache abstraction, and MVC improvements. This session will provide attendees an in-depth look at these major new features as well as an overview of additional enhancements to the framework such as the new c: namespace for constructor arguments, updates regarding Servlet 3.0, and improvements to Spring's integration testing support.
In this session I have described the different types of dependency injections and their usages.
Reference Link : http://en.wikipedia.org/wiki/Dependency_injection
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
This 50 minutes talk covers the novelties of Java EE 7 (easier to understand if you already know Java EE 6). It comes from the talk I gave with Arun Gupta at JavaOne 2013
JPA and Hibernate are specifications and frameworks for object-relational mapping (ORM) in Java. JPA is a specification for ORM that is vendor-neutral, while Hibernate is an open-source implementation of JPA. Both use annotations to map Java classes to database tables. JPA queries use JPAQL while Hibernate supports both JPAQL and its own HQL. Additional features covered include relationships, inheritance mapping strategies, custom types, and querying.
This document provides an overview of new features in Java EE 6, as presented by Antonio Goncalves. It discusses several major new concepts, including profiles, pruning of specifications, portable JNDI names, managed beans, and interceptors. It also summarizes new features for various specifications, such as JPA 2.0 adding richer mappings and criteria queries, EJB 3.1 introducing asynchronous calls and timers, Servlet 3.0 focusing on ease of development and pluggability, and JSF 2.0 making Facelets the preferred view definition language. The document aims to give attendees an understanding of the key changes and improvements in Java EE 6.
Carol McDonald discusses the key themes and technologies in Java EE 6, which was released on December 10, 2009. The major themes of Java EE 6 are right-sizing with modular profiles, extensibility through pluggability, and ease of development through features like dependency injection and managed beans. New and updated specifications in Java EE 6 include CDI 1.0, EJB 3.1, JPA 2.0, JSF 2.0, JAX-RS 1.1, and Servlet 3.0.
This document discusses new features and improvements in Spring 4. It covers Java 8 support including lambda expressions, date/time API updates, and optional types. It also summarizes core container improvements like meta annotations, generic qualifiers, and conditional bean configuration. General web improvements involving the @RestController annotation and Jackson serialization views are outlined. Testing improvements such as active profile resolution and the SocketUtils class are also mentioned.
Introduction to JPA and Hibernate including examplesecosio GmbH
In this talk, held as part of the Web Engineering lecture series at Vienna University of Technology, we introduce the main concepts of Java Persistence API (JPA) and Hibernate.
The first part of the presentation introduces the main principles of JDBC and outlines the major drawbacks of JDBC-based implementations. We then further outline the fundamental principles behind the concept of object relation mapping (ORM) and finally introduce JPA and Hibernate.
The lecture is accompanied by practical examples, which are available on GitHub.
Annotation processing allows for metadata to be added to Java programs without altering the program itself. Annotations can be defined and used to provide information for compilers or allow runtime/compile-time processing. Annotation processors provide a hook into the Java compilation process to generate source code and compile errors/warnings. They work by processing annotated elements in rounds. Testing annotation processors is challenging but libraries like Google's compile-testing library can help. Annotation processing also works on Android by setting up the processor as a Java module and using plugins like android-apt.
This session describes the overview on different types of spring containers. Here we can also find simple examples showing the demo to instantiate the containers.
Dependency injection (DI) with Spring allows defining beans and their dependencies in code rather than XML configuration files. Spring supports DI through its bean factory and container. Beans can be defined through XML configuration or Java configuration using annotations. The Spring container handles injecting dependencies and calling lifecycle methods like @PostConstruct. This allows loose coupling between classes and testability through dependency injection.
Crack your Java interview by knowing all the questions that your interviewer may ask. Brush up your knowledge with this superb set of Java interview questions & answers prepared by BestOnlineTrainers
The document discusses using Hibernate, an object-relational mapping framework, to provide object persistence and retrieval by mapping Java objects to database tables. It explains what Hibernate does, its features like object-relational mapping and transaction management, and provides examples of persisting and retrieving objects using Hibernate's API. The document also shows how to configure a Hibernate project and map classes and associations between objects and database tables.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
Dependency injection with Spring allows managing object dependencies and compositions. It handles composing objects by externalizing the lookup and assembly of collaborating objects. This avoids tight coupling. Spring supports dependency injection through XML configuration, annotations, and Java configuration. It handles creating and assembling objects and their dependencies. Dependency injection improves testability and maintainability of applications.
The document discusses improvements to caching in Spring 4.1, including support for JSR-107 annotations. Some key points:
- Spring now supports JCache (JSR-107) annotations like @CacheResult, which maps to Spring's @Cacheable.
- Examples show how to rewrite Spring caching code to use JSR-107 annotations, including customizing cache names and keys.
- Support for caching exceptions, cache resolvers, and default caching configurations are described.
- Enabling JSR-107 support requires adding the JCache API and spring-context-support dependencies.
BEA Weblogic Interview Questions And Answers provides a guide to preparing for a BEA Weblogic job interview. It includes sample questions and answers about BEA Weblogic, such as what BEA Weblogic is, why polymorphic responses are not allowed from create() or find() methods in EJBs, and how to set up the CLASSPATH correctly. The document provides explanations and recommendations for various BEA Weblogic concepts and configuration issues.
Java EE 7 will focus on enabling Java EE applications and services to easily operate in public and private cloud environments. Key areas of focus include improved packaging for cloud deployment, tighter resource management, and potential new APIs for cloud services. Modularity enhancements based on Java SE 8 modules will allow applications to be composed of independent, versioned modules. The first Java EE 7 specifications have already been approved.
This document provides an overview and comparison of several popular Java web frameworks: JSF, Spring MVC, Stripes, Struts 2, Tapestry and Wicket. It introduces the speaker and outlines the agenda, which includes an introduction, pros and cons analysis, framework "smackdown" based on evaluation criteria, and a question and answer session. The speaker's experience with each framework is also shared.
This document provides an overview of building web applications with J2EE. It introduces key J2EE concepts and technologies including the J2EE architecture with its layered approach, containers that provide services to components, and common technologies used like EJBs, JSF, XHTML. It also discusses J2EE servers, development lifecycles and tools, and provides an example blog application to demonstrate J2EE concepts in practice. The presentation concludes with a Q&A session.
This document provides an overview of Spring MVC, the model-view-controller framework for building web applications in Spring. It discusses Spring MVC's request processing workflow including the front controller and application context. It also covers controllers, mapping requests, returning views and data representation. Key topics include RESTful design, annotations like @RequestMapping and return types, and view resolvers for resolving JSP and other view technologies.
Workshop Spring - Session 1 - L'offre Spring et les basesAntoine Rey
Rejoignez les millions de développeurs Spring
De par sa forte pénétration dans les entreprises, tout développeur Java /JEE a ou aura à travailler sur une application s’appuyant sur Spring. Or Spring dépasse le cadre du simple framework open source.
Cette série de 5 workshops a pour objectif de faire un tour d’horizon de l’écosystème des technologies supportées par Spring avant de se focaliser plus spécifiquement sur certaines d’entre elles.
Retours d’expérience, bonnes pratiques, techniques avancées seront de partie.
Propulsée dans Java EE 6 avec CDI et plus récemment au sein de JavaScript avec Google Gin, l’injection de dépendance sera au cœur du premier workshop.
Voici le support de présentation du workshop sur Spring que j'ai animé en novembre 2011 au sein de ma SSII et que j'ai réactualisé avant sa diffusion sur Slideshare.
Au sommaire du workshop :
1. Zoom sur le portfolio Spring Source
1. Le cœur du framework Spring : IoC, AOP et support
2. Le support proposé par Spring : persistance, présentation, communication, test, outils …
2. Les fondamentaux
1. Fonctionnement du conteneur léger
2. Les beans Spring
3. Les design patterns rencontrés dans Spring
Ce Support de cours Spring contient :
- Architecture JEE (Over view)
- Spring Overview
- Spring IOC
- Spring MVC
- Spring Integration (RMI, JaxWS, JaxRS, JMS, JMX,...)
- Spring Security
Bon apprentissage à tous
EJB 3.0 introduced a simplified programming model for enterprise Java with plain old Java objects (POJOs), dependency injection, and metadata-driven configuration. The new features include support for POJO session beans with simplified lifecycles, the Java Persistence API (JPA) for object-relational mapping, and the ability to define interceptors for cross-cutting concerns.
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
JBoss Application Server 7 includes several key features:
1. It is a lightweight Java EE 6 compliant container that provides fast startup times of less than 3 seconds.
2. It simplifies classloading and configuration for easier management and deployment.
3. It supports the use of managed beans, dependency injection and common services as specified by the CDI specification.
The document provides a multiple choice quiz on Spring Framework concepts. It includes 10 multiple choice questions covering topics like Spring modules, bean scopes, annotation-driven configuration, Spring MVC, transactions, dependency injection, and Aspect Oriented Programming (AOP). It also includes 5 open-ended questions asking about Maven/Gradle, the web.xml file, the <annotation-driven/> tag, ViewResolvers in Spring, and descriptions of common annotations with examples.
This document provides an overview and introduction to the Spring framework. It discusses key Spring concepts like inversion of control (IoC), dependency injection, and the model-view-controller (MVC) architecture. It also summarizes Spring modules for web applications, data access, security, and testing. Code examples are provided for common Spring features like configuration, bean management, MVC controllers, validation, and security.
First lecture in the Java EE training course.
Covers:
- Java EE project setup
- Introduction to Maven
- Web application structure
- JSF basics
- CDI basics
CoffeeScript by Example is a document that provides 7 examples of using CoffeeScript. It summarizes CoffeeScript features like functions defined with ->, jQuery integration, string interpolation, comprehensions, lexical scoping, classes and objects, and function binding. It also discusses unit testing CoffeeScript code with Jasmine and spying with Sinon.js. Resources for learning more about CoffeeScript, related tools like Jasmine and Backbone.js, and the presenter's contact information are provided.
Back-2-Basics: .NET Coding Standards For The Real World (2011)David McCarter
Revamped for 2011 (90% new material), this session will guide any level of programmer to greater productivity by providing the information needed to write consistent, maintainable code. Learn about project setup, assembly layout, code style, defensive programming and much, much more. Code tips are included to help you write better, error free applications. Lots of code examples in C# and VB.NET. This session is based off my latest book, David McCarter's .NET Coding Standards.
This document provides an introduction and overview of the Spring Framework. It discusses that Spring is an open-source application framework that provides dependency injection and inversion of control. It allows for lightweight containers and frameworks. Spring provides dependency management between objects, cleaner separation of responsibilities, and the ability to build applications from POJOs. The document covers key Spring concepts like inversion of control, dependency injection, bean scopes, lifecycle callbacks, and autowiring. It provides examples of how to configure these concepts in Spring.
The document provides an introduction to JUnit testing in Java. It discusses how to set up a JUnit test with the AEM testing framework using the AemContextExtension. Key aspects covered include adding Sling models to the test context, loading mock JSON resources, and adapting requests to test Sling models. The anatomy of a JUnit test is explained with examples of setting up mocks, verifying expectations, and asserting results. Mocking and the Mockito framework are also introduced for simulating dependencies in tests.
Struts 2 is an MVC framework that is the successor to Struts and WebWork 2, providing a simple architecture based around interceptors, actions, and results with conventions over configuration and support for technologies like Spring, Velocity, and Ajax. It aims to bring the best of Struts 1 and WebWork 2 together while being easier to test and use through defaults and annotations. The framework can integrate with many open source libraries and supports features like localization, type conversion, and configuration through XML files and annotations.
This document provides an overview of Spring Boot, a framework for creating stand-alone, production-grade Spring based applications. It discusses how Spring Boot aims to make it easy to create Spring applications with default configurations and minimal code. The key topics covered include: using Maven and Gradle build tools with Spring Boot, common features and conventions like auto-configuration and main application classes, Spring Data and JPA for database access, Spring MVC features for web applications, and testing Spring applications.
This document provides an overview and introduction to Spring Boot. It discusses:
- The goals of Spring Boot to provide a faster setup process and default configurations without needing XML.
- Key features like auto-configuration, embedded servlet containers, and the use of starters for common dependencies.
- Conventions for project structure, main application classes, and defining beans.
- How to configure databases, implement JPA repositories, and build REST APIs with Spring MVC and data REST.
- Tips for testing Spring applications and building executable JAR files for deployment.
This document provides an overview and introduction to Spring Boot. It discusses:
- The goals of Spring Boot to provide a faster setup process and default configurations without needing XML.
- Key features like auto-configuration, embedded servlet containers, and the use of starters for common dependencies.
- Conventions in Spring Boot for project structure, main classes, configuration properties, and more.
- How to set up a Spring Boot project using Maven, including using the spring-boot-starter-parent and starter POMs.
- Support in Spring Boot for Spring MVC, data access with JPA/Spring Data, REST services, and testing.
Testing Web Apps with Spring Framework 3.2Sam Brannen
This document provides an overview of the new testing features in the Spring Framework 3.2, including the Spring TestContext Framework and the new Spring MVC Test Framework. The Spring TestContext Framework allows for annotation-driven unit and integration testing of Spring-managed components. It supports loading application contexts, dependency injection of test instances, and transactional test management. The new Spring MVC Test Framework enables server-side testing of Spring MVC applications without requiring a servlet container. It provides a fluent API for building mock requests and asserting mock responses. The framework also supports testing client-side interactions using the RestTemplate.
Java EE 8 security and JSON binding APIAlex Theedom
Java EE Security and JSON Binding are two new APIs in the Java EE 8 release. The security API provides consistencies between containers with a simple annotation-driven model while JSON Binding completes Java EEs JSON APIs and is a real alternative to Jackson and Gson. In this presentation, I will walk through coding examples from both APIs and by the end of the presentation, you will understand how these two new APIs add to the advancement of the Java EE platform.
The document provides an overview of the Spring Framework, including its core features such as dependency injection, aspect-oriented programming, transaction management, and web frameworks. It discusses how Spring promotes loose coupling, simplifies configuration, and provides abstractions that insulate applications from implementation details. Specific topics covered include DI/IoC, AOP, transactions, data access with Hibernate, and use of the DispatcherServlet web framework.
Eclipse MicroProfile: Accelerating the adoption of Java MicroservicesDev_Events
Emily Jiang, WebSphere Application Server, CDI Development Lead, IBM Cloud @emilyfhjiang
While there are likely a dozen or more Java-based microservice / cloud native initiatives in the industry,
Eclipse MicroProfile provides a platform for Java developers to collaborate and innovate on areas of
common interest. This BOF will give a short overview of MicroProfile and how it plans to optimize
microservices for Enterprise Java, followed by a short Q&A to answer any clarifying questions, and the
remainder of the time spent on collaborating to prioritize features for the next release.
While MicroProfile's first release is founded in Java EE (CDI + JSON-P + JAX-RS), it is not intended to
remain a subset of Java EE 7 (or 8). The intent is to collaborate and innovate as a community in the
context of a microservices architecture across the 5 (and growing) MicroProfile implementations today.
The end goal of MicroProfile is to feed the Java Community Process (JCP) with JSR submissions backed
by well-thought-out concepts and even implementations that developers and enterprises can rely on.
Come collaborate with your fellow MicroProfilers to move Enterprise Java microservices forward.
The document discusses Ajax and how it allows asynchronous communication with a server without reloading the entire web page. It covers the basic objects and methods needed, including the XMLHttpRequest object. The typical Ajax process involves creating an XMLHttpRequest object, sending it to the server, and triggering a response function when the server responds to update the display without reloading the page.
This document discusses logging frameworks and the Log4E Eclipse plugin. It provides an overview of why logging is useful, how Log4E supports different logging frameworks like Log4J and adds logging code automatically. It also gives instructions on downloading, configuring and using Log4J for logging within a Java application created in Eclipse.
- JSP allows embedding Java code within HTML pages using special tags, providing an alternative to plain Java servlets for generating dynamic web pages. The HTML pages are known as JSP files.
- JSP files are translated into Java servlets behind the scenes, with the Java code enclosed in tags executed on the server and HTML returned to the client. This allows generating HTML dynamically based on Java logic and data.
- Common JSP tags include scriptlets for Java code, expressions for outputting values, declarations, includes, and actions to control page flows like includes and redirects. Directives like import affect the compiled servlet class.
Hibernate is an open-source ORM toolkit that provides a framework for mapping Java objects to relational database tables. This mapping is accomplished through an XML configuration file. Hibernate supports querying the database using HQL, a dialect of SQL optimized for objects, or native SQL. It allows for persistence of plain Java objects to and from the database, flexible mapping of objects to tables, powerful queries, and caching for performance.
The document discusses Java Platform, Enterprise Edition (Java EE), which defines a set of technologies for building enterprise applications. It focuses on availability, security, reliability and scalability. Java EE uses a multi-tiered model and includes technologies like Enterprise JavaBeans, Java Servlets, Java Server Pages and more. It defines roles in development and deployment and provides services to applications through application servers.
This document outlines the organization and content of a book on Java programming. It will be divided into four parts covering fundamentals, object-oriented programming, GUI programming, and developing comprehensive projects. Upon completing the course, students will understand primitive data types, control flow, methods, arrays, object-oriented concepts, and core Java classes. They will be able to write simple programs using these elements and develop a GUI interface. The book introduces Java concepts and gets students started with creating, compiling, and running their first Java application.
This document provides an introduction and overview of PHP. It discusses that PHP is a server-side scripting language used for web development that allows code to be embedded within HTML pages. It can be used to connect to databases, generate dynamic web pages, and interact with forms. The document provides examples of basic PHP syntax like variables, echo, includes, control structures, and functions. It also covers sessions, forms, and using PHP to connect to and query a MySQL database.
The document discusses computer programming concepts including what a computer is, what a program and programming are, different types of programs, compilation and linking of code, intermediate languages to achieve OS independence, and .NET framework which provides a common language infrastructure for developing distributed applications. It also discusses technologies like XML, SOAP, and WSDL that enable a common language for the internet.
Hibernate is an open-source ORM toolkit that provides a framework for mapping Java objects to relational database tables. This mapping is accomplished through an XML configuration file. Hibernate supports querying the database using HQL, a dialect of SQL optimized for objects, or native SQL. It allows for persistence of plain Java objects to and from the database, flexible mapping of objects to tables, powerful queries, and caching for performance.
The document discusses testing web applications using Selenium. It describes the unique challenges of testing heterogeneous systems with dynamic pages. It then provides an overview of Selenium and how it can be used to simulate user interactions and automate testing of web applications. Specific techniques discussed include using Selenium IDE to record tests and Selenium WebDriver to programmatically control browsers using various programming languages.
Standard language for querying and manipulating data
Structured Query Language
Many standards out there:
- ANSI SQL, SQL92 (a.k.a. SQL2), SQL99 (a.k.a. SQL3), ....
- Vendors support various subsets: watch for fun discussions in class !
This document provides an overview of the Ruby programming language and the Ruby on Rails web application framework. It discusses that Ruby was created in the 1990s and is object-oriented and interpreted like PHP and Bash. It also summarizes that Rails was initially developed to support rapid development of web applications and can generate the skeleton of an application. The document also provides examples of using Ruby classes and objects.
This document provides an introduction to C++ programming including definitions of basic concepts like variables, data types, input/output functions, conditional statements, loops, and examples of simple programs like printing "Hello World" and calculating a sum. It explains C++ syntax, compiling programs, comments, and comparisons and logical operators used to build conditions.
This document provides an overview of asynchronous JavaScript and XML (Ajax) including how it allows asynchronous client-side script calls to server-side functions, providing a better user experience. Code samples are presented to demonstrate getting data from the server without reloading the page, passing parameters to server-side scripts, and returning classes from the server. Steps for implementing Ajax include adding references, configuring handlers, creating public server-side functions, and accessing those functions through client-side script.
The document discusses the evolution of JavaScript and AJAX technologies over time, including the introduction of frameworks like jQuery, Backbone.js, and AngularJS. It then focuses on explaining the concepts and features of Backbone.js, including models, collections, views, templates, and routers. Examples are provided to demonstrate how to define a basic model and collection in Backbone.js, create views to render them, and fetch and display the data.
This document discusses techniques for reconnaissance, vulnerabilities, and attacks related to cybersecurity. Reconnaissance techniques covered include war dialing, war driving, port scanning, probing, and packet sniffing. Vulnerabilities explored are backdoors, code exploits, eavesdropping, indirect attacks, and social engineering. Attacks analyzed involve password cracking, web attacks, physical attacks, worms/viruses, logic bombs, buffer overflows, phishing, bots/zombies, spyware/malware, hardware keyloggers, eavesdropping/playback, and DDoS. Each topic provides details on method, motivation, detection, and defense.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
2. “Lightweight Container”
◦ Very loosely coupled
◦ Components widely reusable and separately packaged
Created by Rod Johnson
◦ Based on “Expert one-on-one J2EE Design and
Development”
◦ Currently on version 1.1.1
3. Wiring of components (Dependency Injection)
◦ Promotes/simplifies decoupling, design to interfaces, TDD
Declarative programming without J2EE
◦ Easily configured aspects, esp. transaction support
Simplify use of popular technologies
◦ Abstractions insulate application from specifics, eliminate
redundant code, and handle common error conditions
◦ Underlying technology specifics still accessible (closures)
4. Conversion of checked exceptions to unchecked
◦ (Or is this a reason not to use it?)
Not an all-or-nothing solution
◦ Extremely modular and flexible
Well designed
◦ Easy to extend
◦ Many reusable classes
5.
6.
7. Inversion of Control (IoC)
“Hollywood Principle”
◦ Don't call me, I'll call you
“Container” resolves (injects) dependencies of
components by setting implementation object (push)
As opposed to component instantiating or Service
Locator pattern where component locates
implementation (pull)
Martin Fowler calls Dependency Injection
8. Variations on dependency injection
◦ Interface based (Avalon)
◦ Constructor-based (PicoContainer, Spring)
◦ Setter-based (Spring)
BeanFactory provides configuration framework to
initialize and “wire” JavaBeans
◦ org.springframework.beans and org.springframework.context
Typically use the XmlBeanFactory, employing XML
configuration files
9. BeanFactory configured components need have no
Spring dependencies
◦ Simple JavaBeans
Beans are singletons by default
Properties may be simple values or references to
other beans
Built-in support for defining Lists, Maps, Sets, and
Properties collection types.
◦ Custom PropertyEditors may be defined to
convert string values to other, arbitrary types.
11. Direct instantiation
◦ <bean id=“beanId” class=“className”>
BeanFactory instantiation
◦ Same syntax but class is subclass of BeanFactory
◦ getObject() called to obtain Bean
Static Factory
◦ <bean id=“beanId” class=“className" factory-method="
staticCreationMethod“>
Instance Factory Method
◦ <bean id=“beanId” factory-bean=“existingBeanId" factory-
method=“nonStaticCreationMethod">
12. Beans may be singletons or “prototypes”
◦ Attribute singleton=“false” causes instantiation with each
getBean() lookup
◦ Singleton is default
XmlBeanFactory pre-instantiates singletons
◦ May be overridden on per-instance basis by lazy-
init=“true”
Beans may also be marked abstract, allowing
reuse of attribute values through inheritance
13. Beans may be auto-wired (rather than using <ref>)
◦ Per-bean attribute autowire
◦ Explicit settings override
autowire=“name”
◦ Bean identifier matches property name
autowire=“type”
◦ Type matches other defined bean
autowire=”constructor”
◦ Match constructor argument types
autowire=”autodetect”
◦ Attempt by constructor, otherwise “type”
14. Ensures properties are defined
◦ Per-bean attribute dependency-check
◦ None required by default
◦ Verifies autowiring succeeded
“simple”
◦ all but collaborators
“object”
◦ collaborators only
“all”
◦ Collaborators, primitive types, and collections
15. Can define init method called after properties
set
◦ init-method=”<method-name>”
Can define destroy method as shutdown hook
◦ destroy-method=”<method-name>”
May alternatively implement InitializingBean
and/or DisposableBean
◦ At cost of Spring dependency
16. BeanFactoryAware interface provides BeanFactory
for bean
◦ setBeanFactory(BeanFactory)
BeanNameAware interface provides bean name
◦ setBeanName(String)
FactoryBean for beans which are themselves
factories
◦ Object getObject()
◦ Boolean isSingleton()
◦ Class getObjectType()
17. InputStream is = new FileInputStream("beans.xml");
XmlBeanFactory factory = new XmlBeanFactory(is);
MyBeanClass bean = (MyBeanClass)factory.getBean(“myBean”);
ApplicationContext ctx = new
ClassPathXmlApplicationContext("beans.xml");
MyBeanClass bean = (MyBeanClass)ctx.getBean(“myBean”);
OR
18. Extends functionality of BeanFactory
Pre-instantiates singleton beans
Detects and registers BeanPostProcessors and
BeanFactoryPostProcessors
Supports nesting of contexts
ApplicationListener and ApplicationEvents
◦ Initialized and closed predefined
◦ Custom may be created
MessageSource provides i18n messaging
◦ <bean id=”messageSource”
class=”...ResourceBundleMessageSource”/>
◦ Contains list of bundle base names
19. Web applications may use
ContextLoaderListener to initialize Spring
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
web.xml
Automatically done by Spring DispatcherServlet
20. MethodInvokingFactoryBean
◦ Invokes method on registered beans or any static
methods
◦ Stores return value
SingletonBeanFactoryLocator and
ContextSingletonBeanFactoryLocator
◦ Useful for sharing BeanFactories
◦ Eliminate duplication of beans in multiple similar
factories or contexts
21. Defined beans inheriting from
BeanFactoryPostProcessor are detected and invoked
CustomEditorConfigurer
◦ Registers custom PropertyEditors for converting
configuration string values to specific types
AutoProxyCreators
◦ Wrap beans in proxies based on various criteria (name,
metadata, etc)
PropertyResourceConfigurer
Sets from property file and/or system properties
24. Aspect-oriented programming (AOP) provides for
simplified application of cross-cutting concerns
◦ Transaction management
◦ Security
◦ Logging
◦ Auditing
◦ Locking
AOP sometimes (partially) achieved via Decorators
or Proxies
◦ CORBA Portable Interceptors
◦ Servlet Filters
25. Aspect - Implementation of a cross-cutting concern.
◦ Spring Advisors or Interceptors
Joinpoint - Execution point to target
◦ Typically, methods
Advice - Action taken at a particular joinpoint.
Pointcut - A set of joinpoints specifying where advice
should be applied (e.g. Regular expression)
Introduction/Mixin - Adding methods or fields to an
advised class.
Weaving - Assembling aspects into advised objects.
26. Generally, applies aspects to beans using
BeanFactory
◦ Uses Dynamic Proxies if interface available otherwise
CGLIB
◦ CGLIB creates derived class which proxies requests
Bean class may not be final
Less capable than AspectJ
◦ does not have field interception
◦ only runtime weaving solution is available
◦ Closer integration with AspectJ anticipated
27. Pointcut applicability to a class may be
evaluated statically or dynamically
Spring only creates proxies where necessary
public interface Pointcut {
ClassFilter getClassFilter();
MethodMatcher getMethodMatcher();
}
public interface ClassFilter {
boolean matches(Class clazz);
}
28. Pointcut may be statically or dynamically
evaluated based on isRuntime()
Abstract class StaticMethodMatcherPointcut
requires override of 1st
method only
public interface MethodMatcher {
boolean matches(Method m, Class targetClass);
boolean isRuntime();
boolean matches(Method m, Class targetClass, Object[] args);
}
Only called if isRuntime() == true
29. Spring predefined pointcuts
◦ In org.springframework.aop.support package
RegexpMethodPointcut
◦ Union of multiple regular expressions
◦ Uses Jakarta ORO package
ControlFlowPointcut
◦ Similar to AspectJ cflow
◦ Applied if call stack includes specific class and, optionally,
method
UnionPointcut
◦ Merges pointcuts
30. Can have per-class or per-instance Advice
Spring provides several Advice types
Around Advice
AOP Alliance compliant
Must call invocation.proceed() to call target
public class MyAdvice implements AroundAdvice {
Object invoke(MethodInvocation invocation) {
// change arguments, start transaction, lock, etc.
invocation.proceed();
// change return value, stop transaction, unlock,etc.
}
}
31. MethodBeforeAdvice
◦ void before(Method m, Object[] args, Object target)
◦ Cannot alter return type
ThrowsAdvice
◦ Marker interface
◦ Implementors define methods of form:
afterThrowing([Method], [args], [target], subclassOfThrowable)
AfterReturningAdvice
◦ void afterReturning(Object returnValue, Method, m,
Object[] args, Object target)
◦ Cannot modify return value
32. IntroductionInterceptor provides ability to define
mixins
public class RollbackAdvice extends DelegatingIntroductionInterceptor
implements RollbackSupport {
Map map = new HashMap();
void rollback(Date date) {
// rollback to state at given time
}
public Object invoke(MethodInvocation invocation) {
// record change and time of change
}
}
35. Autoproxy bean definitions automatically proxy
selected beans.
BeanNameAutoProxyCreator
◦ Adds listed advisors/interceptors to beans
with names matching regular expression
DefaultAdvisorAutoProxyCreator
◦ Generic autoproxy infrastructure support
◦ Applies all advisors defined in the context
to all beans, proxying appropriately
36. Spring supports obtaining meta data Object
attributes at class, method, and field level
◦ Not yet argument level (as JSR-175)
Currently supports Jakarta Commons Attributes
Support for JSR-175 in work
Metadata support provided via Attributes
interface
◦ Amenable to mocking unlike JDK reflection and
Commons static methods
37. Configuration of autoproxying based on metadata
attributes simplifies configuration
◦ Define custom attribute class
◦ Define Advisor with pointcut based on custom attribute
◦ Add Advisor in ApplicationContext with autoproxy
Examples
◦ Transaction Attributes
◦ Security Attributes
◦ Pooling
◦ Mapping of controllers to URLs
38.
39. Spring provides AOP support for declarative
transactions
Delegates to a PlatformTransactionManager
instance
◦ DataSourceTransactionManager
◦ HibernateTransactionManager
◦ JdoTransactionManager
◦ JtaTransactionManager
41. Declarative transactional support can be added
to any bean by using
TransactionProxyFactoryBean
Similar to EJB, transaction attributes may be
defined on a per-method basis
Also allows definition of pre- and post-
interceptors (e.g. for security)
45. DAO support provides pluggable framework for
persistence
Currently supports JDBC, Hibernate, JDO, and
iBatis
Defines consistent exception hierarchy (based
on RuntimeException)
Provides abstract “Support” classes for each
technology
◦ Template methods define specific queries
46. public class ReservationDaoImpl extends HibernateDaoSupport
implements ReservationDao {
public Reservation getReservation (Long orderId) {
return (Reservation)getHibernateTemplate().load(Reservation .class,
orderId);
}
public void saveReservation (Reservation r) {
getHibernateTemplate().saveOrUpdate(r);
}
public void remove(Reservation Reservation) {
getHibernateTemplate().delete(r);
}
47. public Reservation[] findReservations(Room room) {
List list = getHibernateTemplate().find(
"from Reservation reservation “ +
“ where reservation.resource =? “ +
“ order by reservation.start",
instrument);
return (Reservation[]) list.toArray(new Reservation[list.size()]);
48. public Reservation[] findReservations(final DateRange range) {
final HibernateTemplate template = getHibernateTemplate();
List list = (List) template.execute(new HibernateCallback() {
public Object doInHibernate(Session session) {
Query query = session.createQuery(
"from Reservation r “ +
“ where r.start > :rangeStart and r.start < :rangeEnd “);
query.setDate("rangeStart", range.getStartDate()
query.setDate("rangeEnd", range.getEndDate())
return query.list();
}
});
return (Reservation[]) list.toArray(new Reservation[list.size()]);
}
}
50. JDBCTemplate provides
◦ Translation of SQLExceptions to more meaningful Spring
Runtime exceptions
◦ Integrates thread-specific transactions
MappingSQLQuery simplifies mapping of
ResultSets to Java objects
51.
52. The DispatcherServlet is the Spring Front
Controller
Initializes WebApplicationContext
Uses /WEB-INF/[servlet-name]-servlet.xml by
default
WebApplicationContext is bound into
ServletContext
53. HandlerMapping
◦ Routing of requests to handlers
HandlerAdapter
◦ Adapts to handler interface. Default utilizes Controllers
HandlerExceptionResolver
◦ Maps exceptions to error pages
◦ Similar to standard Servlet, but more flexible
ViewResolver
◦ Maps symbolic name to view
55. Controller interface defines one method
◦ ModelAndView handleRequest(HttpServletRequest req,
HttpServletResponse resp) throws Exception
ModelAndView consists of a view identifier and
a Map of model data
56. CommandControllers bind parameters to data
objects
AbstractCommandController
AbstractFormController
SimpleFormController
WizardFormController