SlideShare a Scribd company logo
Introduction to Building Enterprise Web Application with Spring MVCBy Abdelmonaim Remaniabdelmonaim.remani@gmail.comPolymathic-coder.comSilicon Valley Code Camp v 4.0
Enterprise ApplicationComplexFunctional RequirementsNon-Functional RequirementsExecutionPerformanceReliabilitySecurityEvolutionTestabilityMaintainabilityExtensibilityScalability (Horizontal and Vertical)
Modern Enterprise ApplicationThe ArchitectureN-Tier ApplicationPresentation LayerMicro-Architecture (Commands, Valuators, etc..)MVC PatternService / Business LayerData Access LayerNaked Objects PatternDataMiddlewareResource LookupService locator pattern
Implicit Invocation
Cross-Cutting ConcernsAspect Oriented Programming
FrameworksAn ArchitectureA well defined structure to solve a problemLibraryFramework vs. LibraryInvoking you vs. Being InvokedGeneric vs. SpecificToolsCompiler, Debugger, Etc…Scaffolding and other utilitiesEtc…
FrameworksHeavyweight vs. LightweightThe need for a platform or a stack (JEE as an example)The ability to load in-demand the only the necessary componentsThe memory footprintThe build sizeDeployment easeEtc…
The Spring Framework
What is Spring?Application FrameworkJavaOther Implementations are available (Spring .NET)Open-SourceLightweightPOJO Based By Rod JohnsonExpert One-on-One J2EE Design and Development in, 20022EE without EJB, 2004Becoming the De Facto Standard of Java Enterprise Applications
Features: Inversion ControlThe ProblemResource acquiring viaStatic method of a singleton factoryInstantiation of an concrete classDirectory Services API that allows for discorery and lookup (For example JNDI)Hard Dependencies are createdProblems with reusing code with hard dependenciesPainful Unit Testing in isolation
Features: Inversion ControlThe solutionUse parameterized classesDependencies are decoupled from classesBy Coding against interfacesInversion of Control: Dependency InjectionThe Hollywood Principle “Don't call us, we'll call you.“Wait a minute this a lot of work!Spring to the rescue
The TradeoffResource injection is done at runtimeUsually done using reflectionNo static type checking
Features: AgilityIf you read the Agile Manifesto, Agile is for the most part for a technical prospectiveFrequent deliverablesAbility and ease of refactoringDecoupling , DRY, and TDD are key makes’em easier
Features: AOPOOP creates a hierarchical object model by natureCross cutting concernsare not necessary part of the application logicOccur across the object model in unrelated partsLoggingSecurityTransaction managementEtc…AOP (Aspect Oriented Programming)Modularization of cross cutting concerns
Features: LibrariesPOJO Wrappers for most popular frameworksAllowing injection of dependencies into the standard implementationStrutsJSFApache TapestryEtc…Full support of JEEIntegration with other frameworks
Features: OtherSource: http://www.developersbook.com/spring/images/SpringFrameworkModules.PNG
Spring Core
Spring CoreAll you need to know is:The ContainerThe Bean FactoryManage bean instances (POJOs)’ life cycleConfiguring their dependenciesEtc…Can be used a partially compliant EJB3 ContainerSpring Pitchfork
Spring MVC
Spring MVCA Front Controller PatternDispatcherRequest RoutingControllers are Spring beans (Managed POJOs)No session scope for scalability
Spring MVCViewsJSP, JSF, FlexControllersMany typesCustom controllersModelService LayerDAO for persistenceJDBC and ORM (Hibernate, iBATIS, etc...)
Spring MVC ComplementsSpring Web FlowFor Web Application that areMore dynamicNon-linear without arbitrary end pointsSpring Portlet MVCA JSR 168 compliant Portlet environnentLarge web application composed with subcomponents on the same web page
Spring SecurityFormally Known As Acegi
Code Time!
Spring Security (Acegi)
Security TerminologyAuthenticationthe verification of the user identityAuthorizationPermissions granted to the identified userAccess ControlBy arbitrary conditions that may depend to Attributes of clientsTemporal and Local ConditionHuman User DetectionOtherChannel or Transport SecurityEncryption
Security TerminologyRealmA Defined the authentication policyUserA defined individual in the Application ServerGroupA defined classification of users by common traits in the Application Server.RoleAn abstract name of the permissions to access a particular set of resources in an application
Available FrameworksSpring SecurityFormer AcegiJAAS (Java Authentication and Authorization Service)jGuardApache Shiro
Spring SecuritySecurity is your responsibilityFeatures:It is not the standardNo class loader authorization capabilitiesSimple configurationPortable across containersCustomizable and extendablePluggable authentication and web request URI securitySupport method interception, Single Sign-On, and Swing clients
AuthenticationAuthenticationForm-BasedBasicDigestLDAPNTLM (NT LAN Manager)SSO (Single Sign-On)JA-SIG CASOpen IDAtlassian CrowdSiteMinderX.509
AuthenticationMechanismsInteract with the userProvidersCheck credentialsBundles details in a Thread Local security context holderRepositoriesStore roles and profile infoIn MemoryJDBCLDAPEtc…
AuthorizationWeb AuthorizationURL-BasedWhich URL patterns and HTTP methods are allowed to be accessed by which roleThe rules are top-down with most specific at the topPaths are in Ant format by defaultMethod authorizationReusableProtocol AngosticUses AOPAnnotations SupportJSR 250Spring @SecuredSpring Security 2.5 ELSupport for Instance-based XML
Spring AOP
Cross Cutting ConcernsLoggingTransaction ManagementSecurityCashingSome Business LogicEtc…
Aspect Oriented ProgrammingThe ProblemCode TanglingNo CohesionCode ScatteringNot DRYThe SolutionAspect Oriented ProgrammingAspectJModulation in Aspects and weaving into the application code
Spring APOSpring AOPJava based AOP FrameworkBuilt on top of AspectJInterception based
AOP TerminologyJoint PointA point in the execution of the programPoint CutAn expression that selects one or more joint pointAspectJ Expression LanguageAdviceThe code to be weaved at a joint pointAspectPoint Cut + Advice
Types of AdvicesAnnotationsBeforeAfterReturningAfterThrowingAfterAround

More Related Content

PPTX
Building enterprise web applications with spring 3
PDF
Building Web Application Using Spring Framework
PPTX
JSF 2.3: Integration with Front-End Frameworks
ODP
Spring Portlet MVC
PPT
JSF basics
PPTX
Introduction to ejb and struts framework
PPTX
Jsp with mvc
PPTX
Java server faces
Building enterprise web applications with spring 3
Building Web Application Using Spring Framework
JSF 2.3: Integration with Front-End Frameworks
Spring Portlet MVC
JSF basics
Introduction to ejb and struts framework
Jsp with mvc
Java server faces

What's hot (20)

PPT
Struts Introduction Course
PDF
Lecture 10 - Java Server Faces (JSF)
PPT
Struts course material
PDF
Spring mvc
ODP
Annotation-Based Spring Portlet MVC
PPTX
Introduction to jsf 2
PPT
eSobi Website Multilayered Architecture
ODP
Java Spring MVC Framework with AngularJS by Google and HTML5
DOCX
TY.BSc.IT Java QB U5
PPTX
Best Practices for JSF, Gameduell 2013
PDF
Struts An Open-source Architecture for Web Applications
PDF
Spring MVC Framework
PPTX
Introduction to JSF
PPTX
Struts & hibernate ppt
PPTX
Struts & spring framework issues
PPTX
Spring framework in depth
DOCX
TY.BSc.IT Java QB U5&6
PDF
Spring MVC
PDF
Sun JSF Presentation
PPTX
Spring Web MVC
Struts Introduction Course
Lecture 10 - Java Server Faces (JSF)
Struts course material
Spring mvc
Annotation-Based Spring Portlet MVC
Introduction to jsf 2
eSobi Website Multilayered Architecture
Java Spring MVC Framework with AngularJS by Google and HTML5
TY.BSc.IT Java QB U5
Best Practices for JSF, Gameduell 2013
Struts An Open-source Architecture for Web Applications
Spring MVC Framework
Introduction to JSF
Struts & hibernate ppt
Struts & spring framework issues
Spring framework in depth
TY.BSc.IT Java QB U5&6
Spring MVC
Sun JSF Presentation
Spring Web MVC
Ad

Viewers also liked (20)

PPT
Restructuring a Web Application, Using Spring and Hibernate
PDF
Trustparency web doc spring 2.5 & hibernate
PPTX
Web Application Architecture
PDF
Web application architecture
PPT
Introduction to Google Web Toolkit
PDF
86535551 ciclo-de-vida-jsf
PDF
Java scalability considerations yogesh deshpande
PDF
Pervasive Web Application Architecture
PPT
Top 10 HTML5 frameworks for effective development in 2016
PPTX
Delivering HTML5 and Modern Apps
PDF
Building modern web apps with html5, javascript, and java
PDF
Modern Web App Architectures
PDF
Web app architecture
PPTX
Web Development Technologies
PDF
Structuring web applications with Backbone.js
PPTX
Writing HTML5 Web Apps using Backbone.js and GAE
PDF
How to-choose-the-right-technology-architecture-for-your-mobile-application
KEY
Ning presentation
PDF
Quick Application Development with Web Frameworks
PPT
Top 10 web application development frameworks 2016
Restructuring a Web Application, Using Spring and Hibernate
Trustparency web doc spring 2.5 & hibernate
Web Application Architecture
Web application architecture
Introduction to Google Web Toolkit
86535551 ciclo-de-vida-jsf
Java scalability considerations yogesh deshpande
Pervasive Web Application Architecture
Top 10 HTML5 frameworks for effective development in 2016
Delivering HTML5 and Modern Apps
Building modern web apps with html5, javascript, and java
Modern Web App Architectures
Web app architecture
Web Development Technologies
Structuring web applications with Backbone.js
Writing HTML5 Web Apps using Backbone.js and GAE
How to-choose-the-right-technology-architecture-for-your-mobile-application
Ning presentation
Quick Application Development with Web Frameworks
Top 10 web application development frameworks 2016
Ad

Similar to Introduction To Building Enterprise Web Application With Spring Mvc (20)

PPTX
Java Security Framework's
DOCX
Complete java syllabus 7448062045 Yesdo Sddd
PDF
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
PPT
soa1.ppt
PPT
Spring ppt
ODP
Spring framework
PPT
Spring Framework
PDF
Framework adoption for java enterprise application development
PPTX
Php Web Frameworks
PPTX
Spring Framework
PPTX
Java J2EE Interview Questions Part 2
PPTX
Java J2EE Interview Question Part 2
PPT
Security As A Service
PPTX
Introduction to Spring sec1.pptx
PDF
Java Online Training @monstercourses
PDF
Java online training
PPT
Managing the cloud
PPTX
Spring tutorials
PDF
Stucorner dot-net-training-syllabus
PPTX
Spring Framework Rohit
Java Security Framework's
Complete java syllabus 7448062045 Yesdo Sddd
Oracle Soa Suite 11g Performance Tuning Cookbook Osama Oransa
soa1.ppt
Spring ppt
Spring framework
Spring Framework
Framework adoption for java enterprise application development
Php Web Frameworks
Spring Framework
Java J2EE Interview Questions Part 2
Java J2EE Interview Question Part 2
Security As A Service
Introduction to Spring sec1.pptx
Java Online Training @monstercourses
Java online training
Managing the cloud
Spring tutorials
Stucorner dot-net-training-syllabus
Spring Framework Rohit

More from Abdelmonaim Remani (7)

PDF
The Eschatology of Java
PPT
The Economies of Scaling Software
PPTX
How RESTful Is Your REST?
PPTX
The Rise of NoSQL and Polyglot Persistence
PPTX
The Art of Metaprogramming in Java
PPTX
Le Tour de xUnit
PPT
Introduction To Rich Internet Applications
The Eschatology of Java
The Economies of Scaling Software
How RESTful Is Your REST?
The Rise of NoSQL and Polyglot Persistence
The Art of Metaprogramming in Java
Le Tour de xUnit
Introduction To Rich Internet Applications

Introduction To Building Enterprise Web Application With Spring Mvc