+1 from a facebook friend

Holy crap... I didn't realize you are the driving force behind spring python and published too. Impressive! I have slowly been learning python... Will definitely be checking your books out and messing around with spring python. Belated congratulations!

This was a comment from a past co-worker of mine. Nice to hear! BTW, he is referring both to Spring Python 1.1 and Python Testing Cookbook.

Posted by Greg Turnquist 

Checking properties after configuration by defining after_properties_set

Property driven objects

ApplicationContext will invoke after_properties_set() on any object that has this method, after it has been created and all container-defined properties have been set. Here are some examples of how this can be useful:

Including validation logic in class definitions. If some properties are optional and others are not (or certain combinations of properties need to be set), this is our opportunity to define it, and let the container validate that an object was defined correctly.

Starting up background services. For example, PyroServiceExporter launches a daemon thread in the background after all properties are set.

This quote from the book (page 39) shows a core feature of Spring Python that apparently escaped getting into the project's official documentation. We will patch the docs, but until then, it shows one good reason to get the book: it's up-to-date and has more detailed info than the project site has.

Posted by Greg Turnquist 

5-Star book review about Spring Python 1.1

The author makes it clear that the Spring Framework should not be seen as ‘yet another framework’ but rather as a methodology for software development. I was somewhat skeptical about how a dynamic language such as Python can benefit from Spring Framework. To the contrary, by the end of first chapter I was totally convinced that addition of Spring Python framework will only benefit Python projects of any scale.

Read this great 5-star review of the book!

Posted by Greg Turnquist 

No SpringOne for me

Unfortunately, I won't be attending SpringOne this year. I submitted a couple proposals to talk about Spring Python, but it's not happening. Maybe next go around it will be possible.

I still encourage you to go! The last time I went, I was impressed by how awesome every presentation was. By not being such a large volume conference, I really felt like each presentation was top notch. And the networking was incredible. If you have some budget to spend on a conference, I highly recommend this one.

Bottom line: if you can scrape together some bucks, I suggest visiting a conference; any conference. It is a great way to get out there, find out new stuff, and meet other developers. I have already attended the devLink conference earlier in Nashville. Even though this was a .NET dominated conference, and I'm a Java/Python dev, I still got a whole bunch of goodness by going. The open spaces stuff was the best. It really cooked to take part in several discussions, including one about automated testing.

Posted by Greg Turnquist 

Another success story with Spring Python

I read the SpringPython Book about a month ago, and liked it, so about two weeks ago, started building a small web application with it in an attempt to learn more about it. I have never used Python to build anything larger than a script, so this was a first for me. One reason I haven't even tried to do a Python webapp before is that we are a Java shop, and maintainability becomes an issue. In this instance, however, I think I have a use case which just feels more natural to solve with Python than with Java.
....
As I have mentioned before, this is my very first Python webapp (although I have used Python for scripting (not that much recently), and I have used CherryPy before). It took me around 2 weeks to build this app, which is probably a bit long by the standards of a good Python programmer. I did have a couple of false starts - I wanted to use Apache ActiveMQ for the queueing, so I checked out first stompy and then ActiveMQ's REST interface with Universal Feed Parser before settling on the embedded database approach. But in any case I now have a working (production ready) Python app with a nice web interface, and I don't think I could have done it in this time using something other than SpringPython. SpringPython helped in two ways:
  • Coily provided a working archetype - this helped immensely. Building a webapp involves many components, and having to only work on the application can be a huge time (and effort) saver.
  • Dependency Injection - Since I was familiar with Java Spring, using SpringPython's DatabaseTemplate and @transactional annotations, and even the concepts of ApplicationContext, etc, felt very familiar and intuitive to use.

Go back to the article to see more details including chunks of code, configuration, where the author was able to revise and alter things to meet his needs, and final screen shots of this success story.

Filed under  //  success  
Posted by Greg Turnquist 

Spring isn't just a bunch of XML

The Spring Framework carries a certain legacy that when carried into the Python world, can have strong negative consequences. There are blogs that discuss Should Python and XML Coexist?. Well, I have asked a similar question when I worked at a previous job while working with Java and XML. When I read Rod Johnson's blog entry about a pure Java Spring configuration option, I saw a code example that could become the beginnings of a beautiful relationship:

@Configuration
public class MyConfig {
   @Bean
   public Person rod() {
      return new Person("Rod Johnson");
   }

 

   @Bean(scope = Scope.PROTOTYPE)
   public Book book() {
      Book book = new Book("Expert One-on-One J2EE Design and Development");
      book.setAuthor(rod());  // rod() method is actually a bean reference !
      return book;
   }
}


To me, it seemed simpler to read configuration of code written in the same language as the code itself. When Spring Java Config made its debut, I migrated an existing application over to it immediately. It should be no surprise that when I started Spring Python, this was one of the target features I pursued.
 
When I decided to write the book, it was a no-brainer that I would code all the sample configurations using pure Python. The only areas where it made sense to write about XML was where I wanted to offer that convenient bridge for Java developers to transisition some/all of their code into Python. I have done plenty of upgrades/transitions/rewrites and I have found that the less it takes to move into a new area of technology, the better my chances of success are. Being able to migrate one bit at a time makes it possible to transition smoothly while still adding new features. That is the message I wanted to convey.
 
I was really happy to read a 5-star book review this morning where one of my readers caught this perfectly.

...I can only applaud that despite its Java roots almost no XML is used - that's a good news for all Python programmers fearing that "Spring" means a lot of unnecessary XML, the prevailing majority of examples is in pure Python.
 
Spring Python doesn't mean a lot of XML. Code it with pure Python and enjoy!

Python_code

Filed under  //  ioc   xml  
Posted by Greg Turnquist 

Security doesn't have to be hard

 
Hey, I got the book! I have it and read it now, the security chapter is marvelous - it really helped me. Haven't tried the code as I'm reading it while commuting but I can already see it's going to be very useful.

The security chapter of the book goes into incredible detail about securing your python app using conventional means. And when that isn't enough, it also gives code samples on how to write your own code plugins.  

Filed under  //  security  
Posted by Greg Turnquist 

Slide cast about Spring Python mentions book

You can see a nice Spring Python slideshow. It is based on the slide show I gave at the 2008 SpringOne conference. I updated some of the slides, included some info on where the book goes into more detail, and recorded an audio track. Share and enjoy!

Intro To Spring PythonView more webinars from gturnquist.

Filed under  //  slides   springone  
Posted by Greg Turnquist 

It's here!

Photo

I was super excited to see this on my front porch went I got home today. I've already submitted a proposal to speak about Spring Python at the October SpringOne conference. Last time I did that was in December 2008. It was great meeting fellow Python enthusiasts. It would be even more exciting to meet more of you.

Spring Python 1.1 book is published!

This book has been published! I got word this morning. This is fantastic news! I have been working for so long to get this out. I am happy that my readers can finally get a hold of this tome and start writing some Springy apps. Please visit my first entry written on SpringSource's blog site, which includes key links and information.

Spring Python takes the concepts of Spring and brings them to the world of Python. This includes features like dependency injection, aspect oriented programming, data access, transaction management, security, and remoting. All of these features when used in non-invasive, composable mechanisms, can help you build apps quicker while being able to maintain them over the long term.

A big thank you goes out to the Spring Python developer team that has been supporting me throughout this time frame developing features and fixing bugs. I also thank my two independent technical reviewers: Russ Miles and Sylvain Hellegouarch. These two tech savvy guys really helped pull me from turning what was once an idea in my head into a readable book.

The biggest appreciation is saved for my precious wife, who has given me unconditional support since Day 1 as well as my 11-month daughter. Their patience is incredible given the number of nights I have had to stay up late to write.

Posted by Greg Turnquist