Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the...
Transcript of Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the...
![Page 1: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/1.jpg)
Introduction to Spring.NET
http://www.springframework.net
![Page 2: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/2.jpg)
About
• Joeri Torfs- CEO Softelligent- http://www.softelligent.be
• Benny Michielsen- Using Spring.NET for 4 years- http://www.bennymichielsen.be
![Page 3: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/3.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much More
![Page 4: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/4.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much More
![Page 5: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/5.jpg)
Dependency Management
![Page 6: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/6.jpg)
Dependency Management
![Page 7: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/7.jpg)
Dependency Management
![Page 8: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/8.jpg)
Dependency Management
• Rigidunknown impact of change
• Fragilecascading changes, new errors
• Not reusabledeveloping from scratch can cost less
• Code Rots
![Page 9: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/9.jpg)
Dependency Management
![Page 10: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/10.jpg)
Dependency Management
![Page 11: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/11.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much More
![Page 12: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/12.jpg)
Dependency Injection
Demo !
![Page 13: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/13.jpg)
Dependency Injection
• Heart of the framework
• Better seperation of concerns
• Less dependencies
• Pluggable applications
![Page 14: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/14.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much More
![Page 15: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/15.jpg)
AOP
Wikipedia:
“Aspect-oriented programming (AOP) is a programming paradigm that increases modularity by allowing the separation of cross-cutting concerns, forming a basis for Aspect-oriented software development.”
?
![Page 16: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/16.jpg)
AOP
Demo !
![Page 17: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/17.jpg)
AOP
• Crosscutting (recurring) concerns (code across multiple classes) that can not be resolved by moving it up the inheritance tree can be handled by using Aspect-oriented Programming.
• Logging, security, transactions, caching...
![Page 18: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/18.jpg)
AOP
• Aspect = cross-cutting concern (Advisors / Interceptors)
• Joinpoint = point during execution
• Advice = action on joinpoint (around, before, throws)
• Pointcut = set of joinpoints specifying when advice should be executed
![Page 19: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/19.jpg)
AOP
• Introduction = introducing new interfaces or fields
• Target = object containing the joinpoint (advised/proxied object)
• AOP Proxy = object with advice
• Weaving = assembling aspects to create AOP Proxy
![Page 20: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/20.jpg)
AOP
• Several out of the box:LoggingException HandlingCachingTransactionRetry
• Extensible
![Page 21: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/21.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much more
![Page 22: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/22.jpg)
Services
Demo !
![Page 23: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/23.jpg)
Services
• Encourages POCO classes
• Decide distribution later
• Hosting = configuration
![Page 24: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/24.jpg)
Agenda
• Dependency Management
• Dependency Injection
• AOP
• Services
• Much More
![Page 25: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/25.jpg)
Much more
• Web Framework
• Validation
• Data & NHibernate
• Testing
• Messaging
• ...
![Page 26: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/26.jpg)
Other frameworks
• Castlewww.castleproject.org
• StructureMapstructuremap.sourceforge.net
• Unitywww.codeplex.com/unity
• PostSharpwww.postsharp.org
• ...www.google.com
![Page 27: Introduction to Spring - blog.bennymichielsen.be€¦ · Dependency Injection • Heart of the framework • Better seperation of concerns • Less dependencies • Pluggable applications](https://reader030.fdocuments.in/reader030/viewer/2022041105/5f074c397e708231d41c4a3f/html5/thumbnails/27.jpg)
Q & A