Home Page Icon
Home Page
Table of Contents for
Spring Python 1.1
Close
Spring Python 1.1
by Greg Lee Turnquist
Spring Python 1.1
Spring Python 1.1
Table of Contents
Spring Python 1.1
Credits
About the Author
About the Reviewers
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Getting Started with Spring Python
Spring Python for Python developers
Exploring Spring Python's non-invasive nature
Adding in some useful templates
Spring Python for Java developers
Extending Spring Python
Installing Spring Python
Setting up an environment for Spring Python
Installing from a pre-built binary download
Installing from source
Spring Python community
Summary
2. The Heart of Spring Python—Inversion of Control
Swapping production code with test doubles
More about Inversion of Control
Adding Inversion of Control to our application
Dependency Injection a.k.a. the Hollywood principle
Adding Inversion of Control to our test
Container versus Context
Lazy objects
Scoped objects
Property driven objects
Post processor objects
Context aware objects
Debate about IoC in dynamic languages
Migrating a Spring Java application to Python
Summary
3. Adding Services to APIs
AOP from 10,000 feet
Crosscutting versus hierarchical
Crosscutting elements
Weaving crosscutting behavior
Adding caching to Spring Python objects
Applying many advisors to a service
Performance cost of AOP
AOP is a paradigm, not a library
Distinct features of Spring Python's AOP module
The risks of AOP
AOP is part of the Spring triangle
Testing our aspects
Decoupling the service from the advice
Testing our service
Confirming that our service is correctly woven into the API
Summary
4. Easily Writing SQL Queries with Spring Python
The classic SQL issue
Parameterizing the code
Replacing multiple lines of query code with one line of Spring Python
The Spring triangle—Portable Service Abstractions
Using DatabaseTemplate to retrieve objects
Mapping queries by convention over configuration
Mapping queries into dictionaries
DatabaseTemplate and ORMs
Solutions provided by DatabaseTemplate
How DatabaseTemplate and ORMs can work together
Testing our data access layer with mocks
How much testing is enough?
Summary
5. Adding Integrity to your Data Access with Transactions
Classic transaction issues
Creating a banking application
Transactions and their properties
Getting transactions right is hard
Simplify by using @transactional
More about TransactionTemplate
The Spring Triangle—Portable Service Abstractions
Programmatic transactions
Configuring with the IoC container
Configuring without the IoC container
@transactional versus programmatic
Making new functions play nice with existing transactions
How Spring Python lets us define a transaction's ACID properties
Applying transactions to non-transactional code
Testing your transactions
Summary
6. Securing your Application with Spring Python
Problems with coding security by hand
Building web applications ignoring security
Looking at our web application from 10,000 feet
Handling new security requirements
Authentication confirms "who you are"
Authorization confirms "what you can do"
Time to add security to our application
Accessing security data from within the app
Testing application security
Configuring SQL-based security
Configuring LDAP-based security
Using multiple security providers is easy
Migrating from an old security solution to a new one
Supporting multiple user communities
Providing redundant security access
Coding our own security extension
Coding a custom authentication provider
Some of the challenges with Spring Python Security
Summary
7. Scaling your Application Across Nodes with Spring Python's Remoting
Introduction to Pyro (Python Remote Objects)
Converting a simple application into a distributed one on the same machine
Fetching the service from an IoC container
Creating a client to call the service
Making our application distributed without changing the client
Is our example contrived?
Spring Python is non-invasive
Scaling our application
Converting the single-node backend into multiple instances
Creating a round-robin dispatcher
Adjusting client configuration without client code knowing its talking to multiple node backend
Summary
8. Case Study I—Integrating Spring Python with your Web Application
Requirements for a good bank
Building a skeleton web application
Securing the application
Building some basic customer functions
Coding more features
Updating the main page with more features
Refining the ability to open an account
Adding the ability to close an account
Adding the ability to withdraw money
Adding the ability to deposit money
Adding the ability to transfer money
Showing account history
Issues with customer features
Securing Alice's accounts
Adding overdraft protection to withdrawals
Making transfers transactional
Remotely accessing logs
Creating audit logs
Summary
9. Creating Skeleton Apps with Coily
Plugin approach of Coily
Key functions of coily
Required parts of a plugin
Creating a skeleton CherryPy app
Summary
10. Case Study II—Integrating Spring Python with your Java Application
Building a flight reservation system
Building a web app the fastest way
Looking up existing flights
Moving from sample Python data to real Java data
Issues with wrapping Java code
Summary
Index
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Table of Contents
Next
Next Chapter
Spring Python 1.1
Spring Python 1.1
Greg Lee Turnquist
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset