OpusCollege and the use of Spring and iBatis

Slides:



Advertisements
Similar presentations
Introduction to the Spring Framework
Advertisements

OpusCollege and Spring-DM. OSGi based web applications – three strategies OSGi container embedded in another container: OSGi Bridge Server (OBS)  e.g.
Persistence Jim Briggs 1. 2 Database connectivity: JDBC Java Database Connectivity An API for connecting Java programs (applications, applets and servlets)
Spring, Hibernate and Web Services 13 th September 2014.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
© 2005, Cornell University. Rapid Application Development using the Kuali Architecture (Struts, Spring and OJB) A Case Study Bryan Hutchinson
An Introduction To the Spring M.V.C. Framework Reference From Website By Tom Kochanowicz.
© Internna Technologies 1 IWebMvc Features, Possibilities & Goals.
Address - #22, 1 st Floor, Station View Road, Kodambakkam, Chennai JTech Soft Solutions Website:
The Spring Framework: A brief introduction to Inversion of Control James Brundege
Intro to Spring CJUG - January What is Spring? “The Spring framework provides central transaction control of various objects.” This means that any.
An Introduction to Hibernate Matt Secoske
The Spring Framework A quick overview. The Spring Framework 1. Spring principles: IoC 2. Spring principles: AOP 3. A handful of services 4. A MVC framework.
UNIT-V The MVC architecture and Struts Framework.
Java Frameworks Indy Java Users Group January 29, 2003.
NetArchive Suite Workshop 2011 Technical Track - Code refactoring with the Spring Framework.
Introduction to the Spring Framework By: Nigusse A. Duguma Kansas State university Department of Computer Science Nov 20, 2007.
Spring Overview, Application demo -Midhila Paineni 09/23/2011 Spring Overview, Application demo9/8/20151.
Spring. Spring Overview Spring Container Concepts Spring and AOP Spring and Data Access Managing Transactions and Resources Remoting and Accessing Enterprise.
UPortal Developers MIT August 2004 Persistence Strategy for uPortal 3 Mike DeSimone the r-smart group
Agenda What is Hibernate Spring Integration Questions Overview
The Spring Framework Training Get to know Spring Framework Rohit Prabhakar
Introduction to the Spring Framework Rajesh. Spring Mission Statement J2EE should be easier to use OO design is more important than any implementation.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
JBoss at Work JAW Motors Application Chapter 1-3 Jeff Schmitt October 9, 2006.
Text 16 de mayo de 2009 Spring Framework Part I. Dependency Injection Buenos Aires, May 2009.
Opus College - overview. OpusCollege - background First project: ICT Capacity Building Mozambican Higher Education Institutions Partners: RUG Groningen,
Copyright © 2005 Finetix LLC All Rights Reserved 0 SpringFramework.Net Developer Session Chris Donnan The Peer Frameworks Series -.Net and Java.
Struts J2EE web application framework “ Model 2 ” Model View Controller Controller Servlet Key features XML metadata Struts taglib Simplified form validation.
Spring Framework. Spring Overview Spring is an open source layered Java/J2EE application framework Created by Rod Johnson Based on book “Expert one-on-one.
Introduction to Spring Matt Wheeler. Notes This is a training NOT a presentation Please ask questions Prerequisites – Introduction to Java Stack – Basic.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework,
Introduction to Web Dimitar Nenchev Ivan Nakov
JBoss at Work Databases and JBoss Chapter 4 Jeff Schmitt October 26, 2006.
Database Web.xml load: spring applicationContext and frontcontroller – servlet mappings: *.jsp -> dispatchServlet ApplicationController formController.
Struts Framework Anna Paščenko. What is Struts?  An open source framework for building Java web applications.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
Spring and DWR Frameworks for Rich Web Enterprise Application Thomas Wiradikusuma Presentation to the 20 th.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
1 Spring Framework April, 2012 Lam Ho Lam To. © 2010 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2 1.Spring Overview 2.Framework.
JAVA EE 6 Best Practices for Migrating Spring to WTF ?!?
Kansas City Java User’s Group Jason W. Bedell July 12, 2006
Chapter 9 Web Application Design. Objectives Describe the MVC design pattern as used with Web applications Explain the role and responsibilities of each.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions Buenos Aires, June 2009.
Spring Framework BT Team 25/02/ Spring A lightweight framework that addresses each tier in a Web application. Presentation layer – An MVC framework.
Introduction – ORM, Helloworld Application
Opus College - overview Demo structure modules. OpusCollege - background Project: ICT Capacity Building Mozambican Higher Education Institutions Partners:
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
Introduction to ORM Hibernate Hibernate vs JDBC. May 12, 2011 INTRODUCTION TO ORM ORM is a programming technique for converting data between relational.
Text 16 de mayo de 2009 Spring Framework Part III. Portable Service Abstractions and Spring MVC Buenos Aires, June 2009.
Creative Commons Attribution- NonCommercial-ShareAlike 2.5 License Sakai Programmer's Café Sakai Montreal CRIM Workshop Introduction to Spring Framework.
J AVA T RAINING IN A HMEDABAD By TOPS Technologies 1 TOPS Technologies Java Course.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
CS520 Web Programming Spring – Web MVC Chengyu Sun California State University, Los Angeles.
Training What’s Spring? The leading full-stack Java/JEE application framework.
J2EE Lecture 6: Spring – IoC and Dependency Injection
Structure of a web application
An Introduction To the Spring M.V.C. Framework
Unit 6-Chapter 2 Struts.
By Ru Shen Department of Computer Science UAlbany, 2008
Intro to Spring CJUG - January 2013.
Building an Integrable XBRL Portal Daniel Hamm German Central Bank
CS5220 Advanced Topics in Web Programming Spring – Web MVC
The Model Layer What is Model?
Corso di “Sviluppo di applicazioni Web”
J2EE Application Framework
Introduction to Spring Framework and Dependency Injection
CS5220 Advanced Topics in Web Programming Spring – Web MVC
CS4961 Software Design Laboratory Understand Aquila Backend
Presentation transcript:

OpusCollege and the use of Spring and iBatis

Spring within OpusCollege: Spring Framework Inversion of Control Aspect Oriented Programming

1. Spring Framework

Spring Framework – used in OpusCollege: Spring Core: Web.xml Dispatcher-servlet Spring Context: Application-context (several files, clipped together in web.xml) Web-context (several files, clipped together in web.xml) Spring DAO: JDBC configuration (jdbc.properties + META-INF/context.xml) DAO support Spring ORM: iBatis support (SqlMapConfig.xml) Spring Web MVC (package web and web-module) Spring AOP (package util/LogTracer) Spring Transaction Management (start in package service/StudyManager / transactionManager)

1. Spring Core Web.xml Dispatcher servlet: url-mapping and interceptors (front-controller-servlet.xml) All requests go to 1 (of the) DispatcherServlet(s). Every DispatcherServlet is defined in web.xml Every DispatcherServlet has a WebApplicationContext, default loaded from: /WEB-INF/<servlet-name>-servlet.xml. Functions of the DispatcherServlet: Maps request URL with the controller. Calls the controller. Receives ModelAndView object of the controller. Maps view name to a real view. Calls the view.

2. Spring Context ApplicationContext: WebContext (see: web.xml) Configuration (see: applicationContext.xml) Preloading of Singleton Beans Message Resource Handling Easy integration of AOP through BeanFactoryPostProcessor WebContext (see: web.xml) Context Hierarchy (see: web.xml)

2. Spring Context ApplicationContext: Bean-creation: Constructor-based: through the constructor Setter-based: through properties and dependencies Combination Constructor-based and Setter-based In OpusCollege: setter-based (see applicationContext-xxx.xml)

2. Spring Context Inversion of Control A.k.a. Dependency Injection Usage in OpusCollege : DAO for persistency (package data) Domain model in POJOs (package domain) Service Layer as façade (package service) MVC with (constraint) JSP (package web and web-module)

2. Spring DAO: JDBC configuration Jdbc.properties META-INF/context.xml

3. Spring DAO: DAO Support

3. Spring DAO: DAO Support Spring provides DAO-interfaces for: JDBC Hibernate iBatis JDO Toplink OpusCollege uses iBatis

4. Spring ORM: iBatis Support Simpler than Hibernate, more advanced than JDBC Mapping of SQL queries to Objects and vice versa, including caching Version 1.3 (SqlMap) and 2.0 (SqlMapClient) supported by Spring through SqlMapClientTemplate -> SqlMapClientDaoSupport

4. Spring ORM: iBatis Support Spring Interface for iBatis SQLMaps -SqlMapClientTemplate: sqlMapClientTemplate.queryForObject(“getXById”, id) sqlMapClientTemplate.queryForList(“getXById”, id) sqlMapClientTemplate.update(“insertX”, x) sqlMapClientTemplate.delete(“deleteX” ,id) SQL-maps: <!-- find all Students --> <select id="findAllStudents" parameterClass="map" resultClass="Student"> select * from opuscollege.student INNER JOIN opuscollege.person ON opuscollege.student.personId = opuscollege.person.id ORDER BY lower(person.surnameFull) </select>

5. Spring Web MVC

5. Spring Web MVC The model represents the data (a database or another backend-system) The view is a visual representation of the model The controller makes changes to the model

5. Spring Web MVC OpusCollege - Integration with following ‘view technologies’: JSP & JSTL – the default provided by J2EE Javascript Excel/PDF – render view as document file JasperReports – reporting engine that can render to CSV HTML

5. Spring Web MVC OpusCollege – use of Validator interface: validation of forms and so on (package validators) In the case of an invalid validation a BindException occurs in Spring. For this purpose the Spring Taglib provides ‘spring:bind’

6. Spring AOP i.e. Aspect Oriented Programming Used for: ‘crosscutting concerns’: services, that touch the entire application and therefore are repeated at all/many methods container services (for example logging, security, session mgt., transaction mgt.) In OpusCollege: logging (package config/LogTracer)

OpusCollege – not Spring-specific File-upload and -display (package web.util): Libraries Commons-io and commons-fileupload Internationalization: Multi-lingual through localeChangeInterceptor (see: frontcontroller-servlet.xml) Logging: log4j through AOP (config/LogTracer)

Questions ???