<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>@brunofuster</title>
	<atom:link href="http://brunofuster.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://brunofuster.wordpress.com</link>
	<description>www.wesaveapp.com</description>
	<lastBuildDate>Thu, 03 Nov 2011 16:45:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='brunofuster.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>@brunofuster</title>
		<link>http://brunofuster.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://brunofuster.wordpress.com/osd.xml" title="@brunofuster" />
	<atom:link rel='hub' href='http://brunofuster.wordpress.com/?pushpress=hub'/>
		<item>
		<title>deploying a node.js project on cloudfoundry (mac osx)</title>
		<link>http://brunofuster.wordpress.com/2011/10/27/deploying-your-first-node-js-project-on-cloudfoundry-mac-osx/</link>
		<comments>http://brunofuster.wordpress.com/2011/10/27/deploying-your-first-node-js-project-on-cloudfoundry-mac-osx/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 14:54:55 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[cloudfoundry]]></category>
		<category><![CDATA[expressjs]]></category>
		<category><![CDATA[nodejs]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=531</guid>
		<description><![CDATA[If you don&#8217;t have your cloudfoundry credentials create here: www.cloudfoundry.com I&#8217;ve run into a bug using Mac&#8217;s ruby. If you already use rvm and ruby 1.9.2, you can skip the first step. Found the bug solution here. Setting up Ruby Install rvm: $ bash &#60; &#60;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) Add the following lines to ~/.bash_profile [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=531&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you don&#8217;t have your cloudfoundry credentials create here: <a href="http://www.cloudfoundry.com" title="www.cloudfoundry.com">www.cloudfoundry.com</a></p>
<p>I&#8217;ve run into a bug using Mac&#8217;s ruby. If you already use rvm and ruby 1.9.2, you can skip the first step. Found the bug solution <a href="http://support.cloudfoundry.com/entries/20340376-faq-error-the-input-stream-is-exhausted#overview">here</a>.</p>
<p></p>
<h2 style="margin-top:30px;">Setting up Ruby</h2>
<p>Install rvm:</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ bash &lt; &lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
</div>
<p>
Add the following lines to ~/.bash_profile
</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
# Ruby Version Manager<br />
[[ -s "$HOME/.rvm/scripts/rvm" ]] &amp;&amp; . &#8220;$HOME/.rvm/scripts/rvm&#8221;
</div>
<p>
Update your terminal env with source or open a new terminal
</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ source ~/.bash_profile
</div>
<p>
Now install ruby 1.9.2
</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ rvm install 1.9.2<br />
$ rvm use 1.9.2
</div>
<h2 style="margin-top:30px;">Configuring cloudfoundry</h2>
<p>Install the vmc gem</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ gem install vmc
</div>
<p>Set the target</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ vmc target api.cloudfoundry.com
</div>
<p>Login with your credentials&#8230; vmc will ask for your email and password.</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ vmc login
</div>
<h2 style="margin-top:30px;">Creating a simple express app</h2>
<p>* You need <a href="http://nodejs.org/">Node.JS</a> and <a href="http://npmjs.org/">NPM</a> from now on</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ sudo npm install express jade
</div>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ mkdir sample-project<br />
$ cd sample-project<br />
$ express
</div>
<p>Start your app to check its running:</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ node app.js
</div>
<p>Open http://localhost:3000 and see the Welcome to Express msg :)</p>
<h2 style="margin-top:30px;">Configuring your app to run on cloudfoundry</h2>
<p>Install cloudfoundry module</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ npm install cloudfoundry
</div>
<p>Change your app.js to run locally and at the cloudfoundry</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ vi app.js
</div>
<p>Require the cloudfoundry module</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
var cloudfoundry = require(&#8216;cloudfoundry&#8217;);
</div>
<p>Go to the app.listen line at the end of the file and change to:</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
app.listen((cloudfoundry.port || 3000), (cloudfoundry.host || &#8216;localhost&#8217;));
</div>
<p>Create a file called package.json and put the used modules:</p>
<p>*jade is the view engine</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8221;name&#8221;:&#8221;sample-app-bfuster&#8221;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8221;version&#8221;: &#8220;0.0.1&#8243;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#8221;dependencies&#8221;: {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;express&#8221;:&#8221;",<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;cloudfoundry&#8221;:&#8221;",<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#8221;jade&#8221;:&#8221;"<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}
</div>
<p>Bundle those modules into your project</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ npm bundle
</div>
<h2 style="margin-top:30px;">Deploy your app</h2>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
$ vmc push
</div>
<p>Console output:</p>
<div style="background-color:black;color:white;margin:0 0 20px;padding:5px;">
Would you like to deploy from the current directory? [Yn]: y<br />
Application Name: sample-app-bfuster<br />
Application Deployed URL: &#8216;sample-app-bfuster.cloudfoundry.com&#8217;?<br />
Detected a Node.js Application, is this correct? [Yn]: y<br />
Memory Reservation [Default:64M] (64M, 128M, 256M, 512M or 1G)<br />
Creating Application: OK<br />
Would you like to bind any services to &#8216;sample-app-bfuster&#8217;? [yN]: n<br />
Uploading Application:<br />
&nbsp;&nbsp;Checking for available resources: OK<br />
&nbsp;&nbsp;Processing resources: OK<br />
&nbsp;&nbsp;Packing application: OK<br />
&nbsp;&nbsp;Uploading (33K): OK<br />
Push Status: OK<br />
Staging Application: OK<br />
Starting Application: OK
</div>
<p>Running app: <a href="http://sample-app-bfuster.cloudfoundry.com">http://sample-app-bfuster.cloudfoundry.com</a><br />
source: <a href="https://github.com/bfuster/cf-sample-app">https://github.com/bfuster/cf-sample-app</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/531/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/531/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/531/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=531&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2011/10/27/deploying-your-first-node-js-project-on-cloudfoundry-mac-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>Wesave, save money and help others save too!</title>
		<link>http://brunofuster.wordpress.com/2011/10/26/wesave-save-money-and-help-others-save-too/</link>
		<comments>http://brunofuster.wordpress.com/2011/10/26/wesave-save-money-and-help-others-save-too/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 01:09:11 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[wesave]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=492</guid>
		<description><![CDATA[Hi! I&#8217;ve been working hard on my first iphone app for the past year with some friends: Andre Gil, Beck Novaes and Eduardo Horvath. We hope you enjoy and make use of it! Feel free to send us your feedback at team@wesaveapp.com! Check it out! Wesave is a really cool app! www.wesaveapp.com or you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=492&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi! I&#8217;ve been working hard on my first iphone app for the past year with some friends: <a href="https://twitter.com/#!/andregil">Andre Gil</a>, <a href="https://twitter.com/#!/becknovaes">Beck Novaes</a> and <a href="https://twitter.com/#!/eduardohorvath">Eduardo Horvath</a>.</p>
<p>We hope you enjoy and make use of it! Feel free to send us your feedback at <a href="mailto:team@wesaveapp.com">team@wesaveapp.com</a>!</p>
<p>Check it out! <a href="http://www.wesave.com">Wesave</a> is a really cool app! </p>
<p><a href="http://www.wesaveapp.com">www.wesaveapp.com</a> or you can install it right away on the <a href="http://itunes.apple.com/us/app/wesave/id458544292">AppStore</a> </p>
<p>Video</p>
<span style="text-align:center; display: block;"><a href="http://brunofuster.wordpress.com/2011/10/26/wesave-save-money-and-help-others-save-too/"><img src="http://img.youtube.com/vi/4Onxa4kK5Tg/2.jpg" alt="" /></a></span>
<p>Screenshots</p>
<p><a href="http://brunofuster.files.wordpress.com/2011/10/profile.jpg"><img src="http://brunofuster.files.wordpress.com/2011/10/profile.jpg?w=210&#038;h=315" alt="" title="profile" width="210" height="315" /></a><a href="http://brunofuster.files.wordpress.com/2011/10/offerdetail.jpg"><img src="http://brunofuster.files.wordpress.com/2011/10/offerdetail.jpg?w=700" alt="" title="offerdetail"   class="size-full wp-image-497" /></a><a href="http://brunofuster.files.wordpress.com/2011/10/nearby.jpg"><img src="http://brunofuster.files.wordpress.com/2011/10/nearby.jpg?w=700" alt="" title="nearby"   class="size-full wp-image-496" /></a></p>
<p><a href="http://brunofuster.files.wordpress.com/2011/10/map.jpg"><img src="http://brunofuster.files.wordpress.com/2011/10/map.jpg?w=700" alt="" title="map"   class="size-full wp-image-495" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/492/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=492&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2011/10/26/wesave-save-money-and-help-others-save-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2011/10/profile.jpg" medium="image">
			<media:title type="html">profile</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2011/10/offerdetail.jpg" medium="image">
			<media:title type="html">offerdetail</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2011/10/nearby.jpg" medium="image">
			<media:title type="html">nearby</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2011/10/map.jpg" medium="image">
			<media:title type="html">map</media:title>
		</media:content>
	</item>
		<item>
		<title>uploading an image from iphone to appengine blobstore using vraptor</title>
		<link>http://brunofuster.wordpress.com/2011/03/11/uploading-an-image-from-iphone-to-appengine-blobstore-using-vraptor/</link>
		<comments>http://brunofuster.wordpress.com/2011/03/11/uploading-an-image-from-iphone-to-appengine-blobstore-using-vraptor/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 18:06:06 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[vraptor]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=405</guid>
		<description><![CDATA[Its quite simple to do this. I will represent the back-end using vraptor, a really great mvc web framework. Well, at first, you need to generate the upload URI, provided by GAE&#8217;s SDK. When you&#8217;re working with web forms, you can just call the BlobstoreService to create the Upload URI directly from your JSP, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=405&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its quite simple to do this. I will represent the back-end using <a href="http://vraptor.caelum.com.br/en">vraptor</a>, a really great mvc web framework.</p>
<p>Well, at first, you need to generate the upload URI, provided by GAE&#8217;s SDK. When you&#8217;re working with web forms, you can just call the <a href="http://code.google.com/appengine/docs/java/blobstore/">BlobstoreService</a> to create the Upload URI directly from your JSP, but this is not the case.</p>
<p>We will provide then a resource that will return an URI for the upload.</p>
<p><pre class="brush: java;">

@Resource
@Path(&quot;/image&quot;)
public class ImageController {

    private final BlobstoreSevice blobstoreSevice = BlobstoreServiceFactory.getBlobstoreService();
    private final Result result;

    public ImageController(Result result) {
        this.result = result;
    }

    @Path(&quot;/createUploadURI&quot;)
    public void uploadURI() {
        
        String uploadURI = blobstoreService.createUploadUrl(&quot;/image/upload&quot;);
        result.use(http()).body(uploadURI);
    }

}

</pre></p>
<p>That&#8217;s enough to return the upload URI into the response body (we wont use json or xml at this time to simplify the post).<br />
Just for the record, there&#8217;s an issue when running this at development server. Blobstore won&#8217;t return the URI with its host, although it will return the absolute URI when at production environment.</p>
<p>Lets consume this resource from iphone now using <a href="http://allseeing-i.com/ASIHTTPRequest/">asihttp</a>. </p>
<p><pre class="brush: java;">
#import &quot;ASIHTTPRequest.h&quot;
//...

-(void) getUploadURI {

	NSURL *uri = [NSURL URLWithString:@&quot;http://yourserver.appspot.com/image/createUploadURI&quot;]];
	ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:uri];
	[request setDelegate:self];
	[request startAsynchronous];
}

-(void) requestFinished:(ASIHTTPRequest *)request {

	NSString *uri = [request responseData];
}

-(void) requestFailed:(ASIHTTPRequest *)request {
	
	NSError *error = [request error];
	NSLog(@&quot;error %@&quot;, error);
}
</pre></p>
<p>Now we have the URI to upload an image. Lets create a new objective-c class to handle the upload using asihttp form data (notice that we will also track the upload progress).</p>
<p><pre class="brush: java;">
#import &lt;Foundation/Foundation.h&gt;
#import &quot;ASIFormDataRequest.h&quot;

@interface ImageUpload : NSObject {

	ASIFormDataRequest *formData;
	float progress;
}

@property (nonatomic, retain) ASIFormDataRequest *formData;
@property (nonatomic, assign) float progress;

-(id) initWithImage:(UIImage*)img uri:(NSString*)uri;
-(void) startUpload;

@end
</pre></p>
<p>And it&#8217;s implementation:</p>
<p><pre class="brush: java;">
#import &quot;ImageUpload.h&quot;

@implementation ImageUpload

@synthesize formData, progress;

-(id) initWithImage:(UIImage*)img uri:(NSString*)uri {
	
	NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(img)];

	self.formData = [[ASIFormDataRequest requestWithURL:[NSURL URLWithString:uri]] retain];	
	[self.formData setData:imageData withFileName:@&quot;defaultImage.png&quot; andContentType:@&quot;image/png&quot; forKey:@&quot;defaultImage&quot;];
	[self.formData setDelegate:self];
	[self.formData setUploadProgressDelegate:self];
	
	return self;
}

-(void) startUpload {

	[self.formData startAsynchronous];
}

#pragma mark Upload Progress Tracking

- (void)request:(ASIHTTPRequest *)theRequest didSendBytes:(long long)newLength {
	
	if ([theRequest totalBytesSent] &gt; 0) {
		float progressAmount = (float) ([theRequest totalBytesSent]/[theRequest postLength]);
		self.progress = progressAmount;
	}
	
}

-(void) requestFinished:(ASIHTTPRequest *)request {
	NSLog(@&quot;upload finished&quot;);
}

-(void) requestFailed:(ASIHTTPRequest *)request {
	NSError *error = [request error];
	NSLog(@&quot;error %@&quot;, error);
}

- (void) dealloc
{
	[self.formData release];
	[super dealloc];
}
@end
</pre></p>
<p>Let&#8217;s change the requestFinished: method for /image/getUploadURI to start the upload after its response is done.</p>
<p><pre class="brush: java;">
#import &quot;ImageUpload.h&quot;
//...
-(void) requestFinished:(ASIHTTPRequest *)request {

	ImageUpload *imageUpload = [[ImageUpload alloc] initWithImage:self.imageView.image uri:[request responseData]];
	[imageUpload startUpload];
}
</pre></p>
<p>If you want to track the progress at this view, you can create your own delegate like [imageUpload setUploadTrackingProgress:self] or expose the asihttp method setUploadProgressDelegate:.</p>
<p>At last we will create the resource that Blobstore will call on your server after the upload has been completed. You can now use the <a href="http://code.google.com/appengine/docs/java/images/overview.html">Images Service</a> to get an URI for this image and store it. </p>
<p><pre class="brush: java;">
@Path(&quot;/upload&quot;)
public void upload() {
	Map&lt;String, BlobKey&gt; blobs = blobstoreService.getUploadedBlobs(request);
	BlobKey blob = blobs.get(&quot;defaultImage&quot;);
		
	ImagesService imagesService = ImagesServiceFactory.getImagesService();
	String imageUrl = imagesService.getServingUrl(blob);

	/* datastore.put(imageurl) */
	result.use(Results.http()).body(imageUrl);
}
</pre></p>
<p>We just need to inject the current HttpServletRequest for the BlobstoreService like this:</p>
<p><pre class="brush: java;">
@Resource
@Path(&quot;/image&quot;)
public class ImageController {

    private final BlobstoreSevice blobstoreSevice = BlobstoreServiceFactory.getBlobstoreService();
    private final HttpServletRequest request;
    private final Result result;

    public ImageController(Result result, HttpServletRequest request) {
        this.result = result;
        this.request = request;
    }
...
</pre></p>
<p>References:<br />
<a href="http://vraptor.caelum.com.br/en">vraptor</a><br />
 <a href="http://allseeing-i.com/ASIHTTPRequest/">asihttp</a><br />
<a href="http://code.google.com/appengine/docs/java/blobstore/">Blobstore Service</a><br />
<a href="http://code.google.com/appengine/docs/java/images/overview.html">Images Service</a><br />
<a href="http://ikaisays.com/2010/09/08/gwt-blobstore-the-new-high-performance-image-serving-api-and-cute-dogs-on-office-chairs/">http://ikaisays.com/2010/09/08/gwt-blobstore-the-new&#8230;</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/405/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/405/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/405/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=405&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2011/03/11/uploading-an-image-from-iphone-to-appengine-blobstore-using-vraptor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>restfulie-objectivec simple post, http response codes and basic auth</title>
		<link>http://brunofuster.wordpress.com/2011/01/16/restfulie-objectivec-updates-simple-post-http-response-codes-and-basic-auth/</link>
		<comments>http://brunofuster.wordpress.com/2011/01/16/restfulie-objectivec-updates-simple-post-http-response-codes-and-basic-auth/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 20:45:02 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[restfulie]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=372</guid>
		<description><![CDATA[Now restfulie-objectivec is using by default ASIHTTP. Its too coupled by now, but I&#8217;m working on this and you will be able to extend it and use any http lib. You can now call a simple http post method, without a payload. I&#8217;m working on the JSON marshaller and it will be ready soon.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=372&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Now <a href="https://github.com/caelum/restfulie-objectivec">restfulie-objectivec</a> is using by default <a href="http://allseeing-i.com/ASIHTTPRequest/">ASIHTTP</a>. Its too coupled by now, but I&#8217;m working on this and you will be able to extend it and use any http lib.</p>
<p>You can now call a simple http post method, without a payload. I&#8217;m working on the JSON marshaller and it will be ready soon. </p>
<p><pre class="brush: java;">

Response *response = [[[client at:@&quot;http://localhost:8888/login&quot;] authUser:@&quot;login&quot; andPassword:@&quot;passwd&quot;] post];

if (response.code == 200) {
    NSLog(@&quot;login success&quot;);
} else {
    NSLog(@&quot;login fail&quot;);
}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/372/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=372&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2011/01/16/restfulie-objectivec-updates-simple-post-http-response-codes-and-basic-auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>Restfulie Objective-C startup</title>
		<link>http://brunofuster.wordpress.com/2011/01/12/restfulie-objective-c-startup/</link>
		<comments>http://brunofuster.wordpress.com/2011/01/12/restfulie-objective-c-startup/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 15:59:09 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cocoa]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[restfulie]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=350</guid>
		<description><![CDATA[Restfulie-ObjectiveC development has begun. We&#8217;re open for ObjC developers who might be interested to collaborate! By now you can call HTTP Get methods and marshall JSON responses into objects. For instance, a custom RestClient can be created using Restfulie&#8217;s class method customWithTypes:andCollectionNames: I&#8217;m refactoring the entire project to design it as closer as possible to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=350&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://github.com/caelum/restfulie-objectivec">Restfulie-ObjectiveC</a> development has begun. We&#8217;re open for ObjC developers who might be interested to collaborate! </p>
<p>By now you can call HTTP Get methods and marshall JSON responses into objects. </p>
<p>For instance, a custom RestClient can be created using Restfulie&#8217;s class method customWithTypes:andCollectionNames:</p>
<p><pre class="brush: objc;">

id&lt;RestClient&gt; client = [Restfulie customWithTypes:[NSArray arrayWithObjects:[User class], nil]
                                andCollectionNames:[NSArray arrayWithObjects:@&quot;users&quot;, nil]];

Response *response = [[client at:@&quot;http://localhost:8888/users&quot;] get];
NSArray *users = [response resource];

//or a simple user

Response *response = [[client at:@&quot;http://localhost:8888/users/1&quot;] get];
User *user = [response resource];

</pre></p>
<p>I&#8217;m refactoring the entire project to design it as closer as possible to other Restfulie&#8217;s client implementations, so it might change a lot.<br />
If you&#8217;d like to collaborate, send me an email: brunofuster@gmail.com</p>
<p>I will keep you posted through this blog explaining the lastest changes and the features that are being implemented at the moment. </p>
<p><a href="https://github.com/caelum/restfulie-objectivec">https://github.com/caelum/restfulie-objectivec</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/350/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/350/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/350/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=350&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2011/01/12/restfulie-objective-c-startup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>uploading an image from iphone to Amazon S3 with UIImagePicker and ASIHTTP</title>
		<link>http://brunofuster.wordpress.com/2010/11/03/uploading-an-image-from-iphone-with-uiimagepicker-and-asihttprequests3/</link>
		<comments>http://brunofuster.wordpress.com/2010/11/03/uploading-an-image-from-iphone-with-uiimagepicker-and-asihttprequests3/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 18:04:14 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[cocoa touch]]></category>
		<category><![CDATA[ec2/s3]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=273</guid>
		<description><![CDATA[Just organizing and spreading some ideas and tools ;) Let&#8217;s start creating an UIViewController subclass that will attend to UIImagePickerControllerDelegate protocol, so your iphone user can choose an image to upload: UploadViewController.h This view has an ImageView and two buttons: selectImage and uploadImage. You have to create and connect them through IB (except imagePicker) or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=273&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just organizing and spreading some ideas and tools ;)</p>
<p>Let&#8217;s start creating an UIViewController subclass that will attend to <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerControllerDelegate_Protocol/UIImagePickerControllerDelegate/UIImagePickerControllerDelegate.html">UIImagePickerControllerDelegate</a> protocol, so your iphone user can choose an image to upload:</p>
<p>UploadViewController.h<br />
<pre class="brush: java;">

@interface UploadViewController : UIViewController &lt;UIImagePickerControllerDelegate&gt; {

    IBOutlet UIImageView *selectedImage;
    IBOutlet UIButton *selectImageButton;
    IBOutlet UIButton *uploadImageButton;
    UIImagePickerController *imagePicker;
}

@property (nonatomic, retain) IBOutlet UIImageView *selectedImage;
@property (nonatomic, retain) IBOutlet UIButton *selectImageButton;
@property (nonatomic, retain) IBOutlet UIButton *uploadImageButton;
@property (nonatomic, retain) UIImagePickerController *imagePicker;

- (IBAction) showImagePicker:(id) sender;
- (IBAction) uploadImage:(id) sender;
- (void) uploadToAS3Job;

#pragma mark UIImagePickerControllerDelegate methods

- (void) imagePickerController:(UIImagePickerController *) picker
        didFinishPickingImage:(UIImage *) image
        editingInfo:(NSDictionary *) editingInfo;

- (void) imagePickerControllerDidCancel:(UIImagePickerController *) picker;

@end

</pre> </p>
<p>This view has an ImageView and two buttons: selectImage and uploadImage. You have to create and connect them through IB (except imagePicker) or create them programatically, its your call. </p>
<p>There are also two IBAction methods (showImagePicker and uploadImage). You have to connect their respective buttons using &#8220;touch down&#8221; event. </p>
<p>Now lets code the implementation:<br />
Ps: Import <a href="http://allseeing-i.com/ASIHTTPRequest">ASIHTTPRequest</a> into your project.</p>
<p>UploadViewController.m<br />
<pre class="brush: java;">

#import &quot;UploadViewController.h&quot;
#import &quot;ASIS3Request.h&quot;

@implementation UploadViewController

@synthesize selectedImage;
@synthesize selectImageButton;
@synthesize uploadImageButton;
@synthesize imagePicker;

//create UIImagePickerController when this view has loaded

-(void) viewDidLoad {

    self.imagePicker = [[UIImagePickerController alloc] init];
    self.imagePicker.allowsImageEditing = YES;
    self.imagePicker.delegate = self;
    self.imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
}

//show a modal view with the image picker 

-(IBAction) showImagePicker {

    [self presentModalViewController:self.imagePicker animated:YES];
}

#pragma mark UIImagePickerControllerDelegate
//callback method when an image has been selected 

- (void) imagePickerController:(UIImagePickerController *) picker
        didFinishPickingImage:(UIImage *) image
        editingInfo:(NSDictionary *) editingInfo {

    selectedImage.image = image;
    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

//callback method when the user cancels the selection

- (void) imagePickerControllerDidCancel:(UIImagePickerController *) picker {

    [[picker parentViewController] dismissModalViewControllerAnimated:YES];
}

//upload image action, will run a task in background 

- (IBAction) uploadImage:(id) sender {

    if (self.selectedImage != nil) {
        [self performSelectorInBackground:@selector(uploadToAS3Job) withObject:nil];
    }
}

//upload in background (just a sample, you should use NSOperationQueue)

- (void) uploadToAS3Job {

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
    [ASIS3Request setSharedSecretAccessKey:@&quot;my-secret-access-key&quot;];
    [ASIS3Request setSharedAccessKey:@&quot;my-access-key&quot;];
 
    NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(self.selectedImage)];

    ASIS3ObjectRequest *request = 
            [ASIS3ObjectRequest PUTRequestForData:imageData withBucket:@&quot;bucket&quot; key:@&quot;images/path&quot;];
    [request setShouldCompressRequestBody:YES]; //gzip compression
    [request startSynchronous];

    if ([request error]) {
       NSLog(@&quot;%@&quot;,[[request error] localizedDescription]);
    }

    [pool release];

}

- (void) dealloc {

    [imagePicker release];
    [selectedImage release];
    [selectImageButton release];
    [uploadImageButton release];
    [super dealloc];
}

@end

</pre></p>
<p>Security issues will be discussed in a new post. </p>
<p>References:<br />
<a href="http://www.zimbio.com/iPhone/articles/1109/Picking+Images+iPhone+SDK+UIImagePickerController">http://www.zimbio.com/iPhone/articles&#8230;</a><br />
<a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html">http://developer.apple.com/library/&#8230;UIImagePickerController.html<br />
</a><a href="http://iphone.zcentric.com/2008/08/28/using-a-uiimagepickercontroller/">http://iphone.zcentric.com/&#8230;/using-a-uiimagepickercontroller/</a><br />
<a href="http://iphone.zcentric.com/2008/08/29/post-a-uiimage-to-the-web/">http://iphone.zcentric.com/&#8230;/post-a-uiimage-to-the-web/</a><br />
<a href="http://allseeing-i.com/ASIHTTPRequest/S3">http://allseeing-i.com/ASIHTTPRequest/S3</a><br />
<a href="http://stackoverflow.com/questions/1754184/amazon-s3-post-upload-from-iphone">http://stackoverflow.com/questions/1754184/amazon-s3-post-upload-from-iphone</a><br />
<a href="http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/index.html?UsingHTTPPOST.html">http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/index.html?UsingHTTPPOST.html</a><br />
<a href="http://stackoverflow.com/questions/1053944/uploading-to-amazon-s3-services-from-iphone-app">http://stackoverflow.com/questions/1053944/uploading-to-amazon-s3-services-from-iphone-app</a><br />
<a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/Reference/Reference.html">http://developer.apple.com/library/ios/&#8230;UIImage_Class</a><br />
<a href="http://blog.objectgraph.com/index.php/2010/04/05/download-an-image-and-save-it-as-png-or-jpeg-in-iphone-sdk/">http://blog.objectgraph.com/&#8230;/download-an-image&#8230;</a><br />
<a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/Reference/Reference.html">http://developer.apple.com/library/mac/&#8230;NSData_Class</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/273/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=273&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2010/11/03/uploading-an-image-from-iphone-with-uiimagepicker-and-asihttprequests3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>javageomodel with objectify</title>
		<link>http://brunofuster.wordpress.com/2010/09/21/javageomodel-with-objectify/</link>
		<comments>http://brunofuster.wordpress.com/2010/09/21/javageomodel-with-objectify/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 13:47:40 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[gae]]></category>
		<category><![CDATA[geomodel]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ofy]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=220</guid>
		<description><![CDATA[GeoModel is an useful project (originally in python) ported to java which aims to make your life easier when you want to search near by coordinates in maps using bigtable as storage. The only thing is that javageomodel is too coupled with JPA/JDO and I want to use Objectify. Well, there&#8217;s too much code that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=220&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/apis/maps/articles/geospatial.html">GeoModel</a> is an useful project (originally in python) ported to java which aims to make your life easier when you want to search near by coordinates in maps using bigtable as storage. </p>
<p>The only thing is that <a href="http://code.google.com/p/javageomodel/">javageomodel</a> is too coupled with JPA/JDO and I want to use <a href="http://code.google.com/p/objectify-appengine/">Objectify</a>. Well, there&#8217;s too much code that can be refactored, but this simple change satisfied my needs:</p>
<p>proximityFetch #old<br />
List&lt;T&gt; proximityFetch(Point center, int maxResults, double maxDistance, Class&lt;T&gt; entityClass, <strong>GeocellQuery baseQuery, PersistenceManager pm</strong>)</p>
<p>proximityFetch #new<br />
List&lt;T&gt; proximityFetch(Point center, int maxResults, double maxDistance, <strong>LocationCapableRepositorySearch&lt;T&gt; repositorySearch</strong>)</p>
<p>If you want to search over your LocationCapable entities, you should give a LocationCapableRepositorySearch&lt;T&gt; for javageomodel (ofy sample):</p>
<p><pre class="brush: java;">
public class OfyEntityLocationCapableRepositorySearchImpl implements
		LocationCapableRepositorySearch&lt;Entity&gt; {

	private Objectify ofy;

	public EntityLocationCapableRepositorySearchImpl(Objectify ofy) {
		this.ofy = ofy;
	}

	@Override
	public List&lt;Entity&gt; search(List&lt;String&gt; geocells) {
		return ofy.query(Entity.class)
				.filter(&quot;coordinates.geocells in &quot;, geocells).list();
	}

}
</pre></p>
<p>You might be looking for GeocellQuery. You could just change your LocationCapableRepositorySearch constructor waiting for a query and add some new filters to your search.</p>
<p>Now an Objectify proximity search looks like:<br />
<pre class="brush: java;">
LocationCapableRepositorySearch&lt;Entity&gt; ofySearch = 
                    new OfyEntityLocationCapableRepositorySearchImpl(ofy);

List&lt;Entity&gt; entities = GeocellManager.proximityFetch(center, 20, 1000, ofySearch);
</pre></p>
<p>and I&#8217;ve created a JPALocationCapableRepositorySearchImpl for JPA searches:</p>
<p><pre class="brush: java;">
LocationCapableRepositorySearch&lt;Entity&gt; jpaSearch = 
                    new JPALocationCapableRepositorySearchImpl&lt;Entity&gt;(baseQuery, pm, Entity.class);

List&lt;Entity&gt; entities = GeocellManager.proximityFetch(center, 40, 1000, jpaSearch);
</pre></p>
<p>You can find the new source at <a href="http://github.com/bfuster/javageomodel">http://github.com/bfuster/javageomodel</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/220/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/220/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/220/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=220&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2010/09/21/javageomodel-with-objectify/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>to read list</title>
		<link>http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/</link>
		<comments>http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 22:01:54 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[cloud]]></category>
		<category><![CDATA[ec2/s3]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[hadoop]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=179</guid>
		<description><![CDATA[just hope to finish them all ;) update: the appengine and scala book are great, not that i&#8217;ve finished yet&#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=179&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[
<a href='http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/screen-shot-2010-08-19-at-6-37-59-pm/' title='Screen shot 2010-08-19 at 6.37.59 PM'><img data-attachment-id='186' data-orig-size='457,608' data-liked='0'width="112" height="150" src="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-37-59-pm.png?w=112&#038;h=150" class="attachment-thumbnail" alt="Screen shot 2010-08-19 at 6.37.59 PM" title="Screen shot 2010-08-19 at 6.37.59 PM" /></a>
<a href='http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/screen-shot-2010-08-19-at-6-37-20-pm/' title='Screen shot 2010-08-19 at 6.37.20 PM'><img data-attachment-id='187' data-orig-size='545,616' data-liked='0'width="132" height="150" src="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-37-20-pm.png?w=132&#038;h=150" class="attachment-thumbnail" alt="Screen shot 2010-08-19 at 6.37.20 PM" title="Screen shot 2010-08-19 at 6.37.20 PM" /></a>
<a href='http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/screen-shot-2010-08-19-at-6-36-57-pm/' title='Screen shot 2010-08-19 at 6.36.57 PM'><img data-attachment-id='188' data-orig-size='535,687' data-liked='0'width="116" height="150" src="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-36-57-pm.png?w=116&#038;h=150" class="attachment-thumbnail" alt="Screen shot 2010-08-19 at 6.36.57 PM" title="Screen shot 2010-08-19 at 6.36.57 PM" /></a>
<a href='http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/screen-shot-2010-08-19-at-6-36-02-pm/' title='Screen shot 2010-08-19 at 6.36.02 PM'><img data-attachment-id='189' data-orig-size='545,692' data-liked='0'width="118" height="150" src="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-36-02-pm.png?w=118&#038;h=150" class="attachment-thumbnail" alt="Screen shot 2010-08-19 at 6.36.02 PM" title="Screen shot 2010-08-19 at 6.36.02 PM" /></a>
<a href='http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/screen-shot-2010-08-19-at-6-35-20-pm/' title='Screen shot 2010-08-19 at 6.35.20 PM'><img data-attachment-id='190' data-orig-size='520,687' data-liked='0'width="113" height="150" src="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-35-20-pm.png?w=113&#038;h=150" class="attachment-thumbnail" alt="Screen shot 2010-08-19 at 6.35.20 PM" title="Screen shot 2010-08-19 at 6.35.20 PM" /></a>

<p>just hope to finish them all ;)</p>
<p>update: the appengine and scala book are great, not that i&#8217;ve finished yet&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=179&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2010/08/19/some-resources-im-diving-into/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-37-59-pm.png?w=112" medium="image">
			<media:title type="html">Screen shot 2010-08-19 at 6.37.59 PM</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-37-20-pm.png?w=132" medium="image">
			<media:title type="html">Screen shot 2010-08-19 at 6.37.20 PM</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-36-57-pm.png?w=116" medium="image">
			<media:title type="html">Screen shot 2010-08-19 at 6.36.57 PM</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-36-02-pm.png?w=118" medium="image">
			<media:title type="html">Screen shot 2010-08-19 at 6.36.02 PM</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/08/screen-shot-2010-08-19-at-6-35-20-pm.png?w=113" medium="image">
			<media:title type="html">Screen shot 2010-08-19 at 6.35.20 PM</media:title>
		</media:content>
	</item>
		<item>
		<title>objective-c consuming rails restful webservices</title>
		<link>http://brunofuster.wordpress.com/2010/07/28/objective-consuming-rails-restful-webservices/</link>
		<comments>http://brunofuster.wordpress.com/2010/07/28/objective-consuming-rails-restful-webservices/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 20:12:09 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[objective-c]]></category>
		<category><![CDATA[ruby/rails]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=108</guid>
		<description><![CDATA[I&#8217;ve been studying ruby and objective-c for a while and found the ObjectiveResource project very interesting. Actually, its a good way to start developing some app for iphone consuming your rails RESTful webservices without worrying (so much) about objects serialization (to and from) or to use JSON/XML at your view controllers. They have a great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=108&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been studying ruby and objective-c for a while and found the <a href="http://iphoneonrails.com/">ObjectiveResource</a> project very interesting. Actually, its a good way to start developing some app for iphone consuming your rails RESTful webservices without worrying (so much) about objects serialization (to and from) or to use JSON/XML at your view controllers.</p>
<p>They have a great <a href="http://www.vimeo.com/3077209">screencast</a> for starters and there&#8217;s a <a href="http://groups.google.com/group/objectiveresource">objectiveresource group</a> that will answer your doubts asap. </p>
<p><strong>Quick start</strong></p>
<p>Assuming you have RESTful webservices for some User domain and have imported the <a href="http://github.com/yfactorial/objectiveresource">ObjectiveResource API</a> to your xcode project, create an objective-c interface and implementation for User:</p>
<p>User.h<br />
<pre class="brush: java;">
@interface User : NSObject {
    NSNumber *userId;
    NSString *name;
    NSString *email;
}

@property (nonatomic, retain) NSNumber *userId;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *email;
@end
</pre></p>
<p>User.m<br />
<pre class="brush: java;">
#import &quot;User.h&quot;

@implementation User
@synthesize userId, name, email;
@end
</pre></p>
<p>Configure ObjectiveResource at applicationDidFinishLaunching method from AppDelegate using the ObjectiveResourceConfig class method setSite:</p>
<p><pre class="brush: java;">
[ObjectiveResourceConfig setSite:@&quot;http://localhost:3000&quot;];
</pre></p>
<p>The response type can be defined using setResponseType: XmlResponse | JSONResponse.</p>
<p>You can use http basic auth as well:</p>
<p><pre class="brush: java;">
[ObjectiveResourceConfig setUser:@&quot;brunofuster&quot;];
[ObjectiveResourceConfig setPassword:@&quot;brunofuster&quot;];
</pre></p>
<p>Now its easy to get your users:</p>
<p><pre class="brush: java;">
import &quot;ObjectiveResource.h&quot;
... 
-(NSArray) getUsers {
  NSArray *users = [User findAllRemote];
  return users;
}
</pre></p>
<p>This will consume /users.json|xml and serialize the response into an array of fresh new User objects. </p>
<p>There are methods for CRUD operations like saveRemote, destroyRemote, updateRemote and findRemote (based on <a href="http://api.rubyonrails.org/classes/ActiveResource/Base.html">ActiveResource</a>),  although you can create your own calls like &#8220;search_users_nearby&#8221; (check the <a href="http://iphoneonrails.com/getting-started">getting started</a> tutorial).</p>
<p>Important: <strong>ObjectiveResource calls aren&#8217;t async</strong>. You should use <a href="http://github.com/yfactorial/objectiveresource/blob/1.1/Classes/lib/ConnectionManager.m">ConnectionManager</a> (<a href="http://github.com/yfactorial/objectiveresource">branch 1.1 at github</a>). Check a sample at <a href="http://gist.github.com/66593">http://gist.github.com/66593</a> </p>
<p>Quite interesting, uh ? </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=108&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2010/07/28/objective-consuming-rails-restful-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>
	</item>
		<item>
		<title>transfer object pattern &amp; annotations (pt_BR)</title>
		<link>http://brunofuster.wordpress.com/2010/07/28/transfer-object-pattern-annotations/</link>
		<comments>http://brunofuster.wordpress.com/2010/07/28/transfer-object-pattern-annotations/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 19:34:49 +0000</pubDate>
		<dc:creator>brunofuster</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://brunofuster.wordpress.com/?p=105</guid>
		<description><![CDATA[Como o título já diz, este post demonstra algumas implementações para facilitar a cópia de objetos semelhantes. Para menor acoplamento entre a camada de visualização (Adobe Flex) e o banco de dados, utilizamos DTOs que são (quase) espelhos de Entidades. Ganhamos flexibilidade para criar objetos mais produtivos para o front-end, o que torna(va) o back-end [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=105&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Como o título já diz, este post demonstra algumas implementações para facilitar a cópia de objetos semelhantes. </p>
<p>Para menor acoplamento entre a camada de visualização (Adobe Flex) e o banco de dados, utilizamos DTOs que são (quase) espelhos de Entidades. Ganhamos flexibilidade para criar objetos mais produtivos para o front-end, o que torna(va) o back-end improdutivo ao tentar espelhar entidades. </p>
<p>A cópia de objetos pode ser feita com apenas uma linha de código (6) e mais algumas anotações. </p>
<p><img src="http://brunofuster.files.wordpress.com/2010/07/dto2.png?w=700" alt="" title="dto2" class="aligncenter" /><br />
Opniões e colaboração são bem-vindos. </p>
<p><a href="http://github.com/bfuster/dtomanager">http://github.com/bfuster/dtomanager</a><br />
<a href="http://projetos.vidageek.net/mirror/mirror/" target="_blank">Mirror DSL</a></p>
<p><a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html" target="_blank">Core J2EE Patterns, Transfer Object </a><br />
<a href="http://en.wikipedia.org/wiki/Factory_method_pattern" target="_blank">Factory method pattern</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/brunofuster.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/brunofuster.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/brunofuster.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=brunofuster.wordpress.com&amp;blog=6929492&amp;post=105&amp;subd=brunofuster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://brunofuster.wordpress.com/2010/07/28/transfer-object-pattern-annotations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25a3259811b826f44d7a8e444b802e71?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">brunofuster</media:title>
		</media:content>

		<media:content url="http://brunofuster.files.wordpress.com/2010/07/dto2.png" medium="image">
			<media:title type="html">dto2</media:title>
		</media:content>
	</item>
	</channel>
</rss>
