
Objective
This article will show you how to implement a full text search in Google App Engine using JDO. I tried my hand at this couple month ago, but after watching this presentation I decided to do it properly.
The Problem
In my first attempt I managed to get the search working, but after watching Brett Slatkin’s presentaion I realized where the problem is. In short deserializing a list of strings (which is our search index) is a very costly operation, but he presented with a solution. Bellow you will find my solution to this problem.
Continued…
Posted in Google App Engine.
Tagged with Google App Engine, JDO.
By Tomas Mazukna
– May 19, 2010

Objective
This post will show you how to use Spring JDBC Template to perform real world CRUD operations. I hope I can show you that you do not need overweight Hibernate to interact with database of your choice.
The Problem Domain
Almost all application I have coded needed to store and get data of some sort. In most cases it was relational database. With hibernate being all the rage these days I have used it in multiple projects with varying degree of problems and success. In my personal opinion hibernate tries to solve a problem that really is not there. If you can not wire SQL you should not be using Hibernate or be doing any software development.
Continued…
Posted in Spring Framework.
Tagged with jdbc, JDO, Spring Framework.
By Tomas Mazukna
– February 23, 2010

Objective
I just wanted to share my thoughts about the frameworks in the Flex environment. You may have noticed that I am in love with Spring when I write Java code, but how about Flex? For a simple example application I go with KISS (keep it stupid simple) approach, but for serious data driven app I utilize a framework.
How to choose a framework that works for You
Firs of all you need to know what you are looking for, because if you do not know where you are going, any path will take you there. When I first started to p[lay with Flex about 3 years ago, I noticed that I need to add some structure to the application. Since I was already using Spring I started looking for a framework. At that point in time there where only two alternatives worth looking at: Cairngorm (heavily pushed by Adobe) and PureMVC.
Continued…
Posted in Flex, The Journey.
Tagged with Flex, Robotlegs.
By Tomas Mazukna
– February 17, 2010

Objective
This article will show you how to implement a simple search in Google App Engine using JDO engine including searching in child objects.
The Problem Domain
In my application I need to search for data and you probably need to do the same in yours. In Google App Engine you can not query for properties of the child objects. In SQL world this means you can not use “where” clause. So how we can not construct a query which looks at child objects. So how can we implement search in such restrictive environment?
Continued…
Posted in Google App Engine, Spring Framework.
Tagged with Google App Engine, JDO.
By Tomas Mazukna
– February 10, 2010

Objective
This article will show you how to persist real world data in Google App Engine. You will learn how to handle inheritance and one-to-many owned relationships in your model objects and store them correctly in the big table implementation of JDO.
The Problem Domain
In my application I need to segregate data by the customer this data belongs to. We will use inheritance in model objects, so all of them will have customer id defined in the base class. We will make the JDO save base class properties in the sub class “table”. We will also learn how to instruct Google App Engine JDO to handle customers with multiple addresses and phone numbers for us. If we define the relationship between model objects correctly JDO will manage storing/retrieving/deleting of these lined objects without our involvement.
Continued…
Posted in Google App Engine, Spring Framework.
Tagged with Google App Engine, Spring Framework.
By Tomas Mazukna
– January 13, 2010

Objective
We are talking REST+JSON from browser to the server and back, so we need to report errors nicely. Exception thrown on the server have to be converted to error messages and transmitted to the client in JSON format. Luckily there is a very elegant solution for this in Spring.
HandlerExceptionResolver interface
Spring provides a very handy HandlerExceptionResolver interface for mapping exceptions to views. If you check the documentation (and you should) you will notice that where are couple exception handlers already implemented, but we will create our own. Just because we can.
Continued…
Posted in Google App Engine, Spring Framework.
Tagged with Google App Engine, json, Spring Framework.
By Tomas Mazukna
– December 16, 2009

Objective
After reading this post you will be able to implement robust user authentication and authorization scheme without replicating code to check if user is logged in and if the are authorized to perform a certain action.
The Problem Domain
You, like me, face the same problem with each web application – user authentication and authorization. Who is logged in? Can they delete this entity? Can they see this report? How to solve this problem without copy pasting same piece of code to every servlet/action/controller/whatever? If you are using spring MVC there is a very elegant and powerful solution – Interceptors.
You can have as many interceptors as you like, I usually have one for security and maybe one more for some other task. Interceptor fires before your controller/action gets invoked. If it returns true the flow can continue, if it returns false the execution stops right there – request has been handled by the interceptor.
Continued…
Posted in Google App Engine, Spring Framework.
Tagged with Google App Engine, Spring Framework.
By Tomas Mazukna
– November 18, 2009

Objective
Once you are finished with this article, you will be able to store application data in Google App Engine Data store and consume REST service using flex client.
Common Problems and Solutions
In my personal opinion flash player security model is the biggest piece of bullshit I ever encountered. If you sit down and thing just for 10 seconds about how it is implemented you will have to agree that it provides NO security at all. It just makes impossible so do certain things, that’s all. Adobe needs to drop it now.
Here is the problem that we have with REST and Google app engine: Adobe’s implementation of HTTPService only supports GET and POST, to consume REST we need at least 3 methods: GET, POST and DELETE. We can live without PUT – if id is null JDO will create a new persisted object, if it is set JDO will update it. But we still do not have support for DELETE. Continued…
Posted in Flex, Google App Engine, Spring Framework.
Tagged with Flex, Google App Engine, json, Spring Framework, Technology.
By Tomas Mazukna
– October 29, 2009
Recent Comments