Spring Python 1.0.0 (RC2) is released

By Greg Turnquist

Greg L. Turnquist worked on the Spring team for over thirteen years and is a senior staff technical content engineer at Cockroach Labs. He was the lead for Spring Data JPA and Spring Web Services. He wrote Packt's best-selling title, Learning Spring Boot 2.0 2nd Edition, and its 3rd Edition follow-up along many others.

June 3, 2009

What is Spring Python?

For those of you new to this project, Spring Python takes the concepts implemented by the Spring Framework (Java), and applies them to Python. This provides a powerful library of functionality to help you get back to writing the code that makes you money. You can visit Spring Python’s official web page, or skip right to the downloads.

You’re Late!

Yes, we’re a tad late. Okay, we’re really late, but in case you fell off the planet, SpringSource lost a valuable member of its team, Russ Miles, who was also the sponsor for this project. There were other high priority things happening, so considering this is an extension, it took a little longer than usual to get to making a release. Which brings me to my next point. I want to welcome Mark Pollack as the new sponsor for this extension. He is the code geek that developed Spring .NET. I have had the benefit of meeting him at least year’s SpringOne Americas conference and attending his presentation, and we have also corresponded over email and IM.

So what’s in this release?

You can scroll down to see the release notes. There actually isn’t much change in the code. We are trying to freeze things into a stable API. However, one thing not listed was a key problem we had to solve with coily. coily is the command-line tool that let’s you download Spring Python plugins. Coily was having trouble handling data hosted on the S3 servers used to stage these downloads, so I had to fix it. It now offers you the correct name.

When you query this version to see what plugins are available, you should see this:

$ ./coily --list-available-plugins
Coily v1.0.0 - the command-line management tool for Spring Python
===============================================================================
Copyright 2006-2008 SpringSource (http://springsource.com), All Rights Reserved
Licensed under the Apache License, Version 2.0

Available plugins:
gen-cherrypy-app springpython-plugin-gen-cherrypy-app-1.0.0-RC1.tar.gz 2009-01-22 18:08
gen-cherrypy-app springpython-plugin-gen-cherrypy-app-1.0.0-RC2.tar.gz 2009-06-03 18:23

You may be seeing two copies listed here, but when you try to install, it will grab RC2’s version.

Release Notes

Release Notes – SX Spring Python – Version 1.0.0-RC2

Improvement

Task

What is coming next?

Well, I have been in contact with a company in Germany that is using Spring Python as a key piece of their software solution. They have even granted me access to view their code base. It is exciting seeing them in action, especially since they are writing some extensions to Spring Python and also experimenting with using it inside Jython.

What does this boil down to? Community feedback is a key ingredient to finding out what features need to be added, modified and improved.  Through IM and email, we have already identified some mods to DatabaseTemplate supporting convention-over-configuration, and have already coded a SimpleRowMapper. If your POPO’s attributes match the column names of a query, you don’t need to create a custom RowMapper. Instead, plug-in this one, and it will link them together, without requiring you to extend any of Spring Python’s classes.

self.databaseTemplate.query(
"select name, category from animal",
rowhandler=SimpleRowMapper(testSupportClasses.Animal))

SimpleRowMapper only needs a class name. It will instantiate one of these classes for each row, and then populates the name and category attributes with the results of the query.

There is also a DictionaryRowMapper, which returns a list of dictionaries, instead of tuples. The key point is that convention-over-configuration has become an accepted way to rapidly write essential code without getting caught up the details, and Spring Python embraces this concept.

There is just one wrinkle to make this work: the API used in RowMapper has a slight change (we added metadata as an optional attribute). Since 1.0 is a frozen API, and we are trying to get to a final release, Sven and I agreed to put this change into Spring Python v1.1, so for now, you can only get it from our source repository. Stay tuned for updates!

3 Comments

  1. Timmy

    Nice work, but will there soon be any support for the Django framework as well? This would certainly push spring python to an higher level.

    Reply
  2. Sven

    It’s the opposite. It would push Django to a higher level 🙂

    If you see how the Spring Technology works, it’s not a question of availability for the different existing frameworks.

    You can use as much SpringPython as you like in your projects. Only a little bit for some tasks or in deep for your whole project.

    An integration into Django is possible step-by-step.

    Reply
  3. gregturn

    Thanks for your feedback, Timmy. Feedback means a lot to this project.

    I agree that support for Django is a great idea. Well…I have several things I want to add that would be great support, like more authentication providers.

    We are already working on v1.1 with a slight change to the APIs for DatabaseTemplate, allowing you to use convention-over-configuration for queries. CherryPy was a nice start, but extending things into Django would be nice as well.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *