A life comited to learning

Category: WEB 2.0

Continue Reading

Quick introduction to REST and JAX-RS

Here are some slides introducing to REST world. Examples are using JAX-RS (JSR 311).

If we’re moving to the cloud-era, the undestanding of this architecture style is essential. In the cloud we are presented with services (Storage, Search, Graph, Geolocation, …) that we can and should use to build applications. Almost all of these services, available  in the cloud, provide some kind of interface and happens that, this  interfaces is, generally, a RESTful Web Service. If I want collaborate with these services I must talk the same language!! Moreover, exploring this architectural style in new applications opens the door for realy distributed and scalable systems, while the simplicity is kept high!

Here the slides:

PDF can be downloaded from here.

Continue Reading

Software Architecture disruption?

:Adrian Colyer is a smart guy and he  put together, in a talk, what software architectures will look like for the next years. True is, most of the services you’re using online today follow these architecture principles. Nothing new, thought.

Nothing in this architecture is can go wrong,  it’s so simple! This type of architecture is the perfect fit for this ubiquitous platform that is Internet.

Btw,  SpringSource makes it really easy to develop applications in this way, just look to Spring Integration project, for example. They have a plenty of projects, built on top of Spring, that makes development of this type of architectures more, and more fun and easy.

(Ignore the sound problems at the beginning 🙂 )

Contrast this with traditional “enterprise” architectures. Which side of the fence you want to be?

Continue Reading
Continue Reading

The problem with Java Web development frameworks is…

Well, from my point of view, the problem of Java Web development frameworks is that there are too many. Each one has its strengths and weaknesses, like anything else. I’m excluding those that are proprietary and you have to pay to use them. Really, why would people pay for such kind of thing?

Focusing on what is open source, you just need to see those supported by Apache: http://projects.apache.org/indexes/category.html#web-framework

Then you can see a list of Java web development frameworks (result of a Google search):
http://java-source.net/open-source/web-frameworks

There’s are so many and the community does not focus on building a complete Java Web Development Framework. The one I like more is Play! Framework because it’s a complete stack of java technologies that really help the development of web apps and it borrows many concepts from Ruby on Rails, which it’s my favorite.

I don’t know every Java web development framework, of course, and each must have their strengths and serve different purposes, but my feeling is that if there were only a few, then the community will focuses on improving those and we’ll end with a truly good framework.

Continue Reading

Yeahh, I’m building it with enterprise ready technologies… who cares?

If you have an web product idea and want to test it, i.e. put it in front of your users, what it’s the most critical aspect to consider first? I usually get my head into a conflict, because I’m used to work with the so-called “enterprise ready technologies”, namely JEE. My mind if formatted to think about all aspects that a good enterprise product should have. I start giving more attention to a set of quality attributes like performance, usability, reusability, testability, portability, modifiability, etc, etc, and give less attention to one critical aspect, if I want to get a product in front of the users fast: productivity.

So, I start looking to what is out there that is enterprise ready, like EJBs, JSF, Hibernate, JBoss, Tomcat, whatever, and start getting the pieces together…. out there in the world there was some a guy with the same product idea, but considered first the productivity aspect of the equation and started to materialize the idea with, let’s say, Ruby on Rails…. guess who’s the winner?

I’m not against the use of JEE, of course, I just think that in some cases it does not make sense. I also have this false argument in my mind: What if I start building it with PHP and then hit a performance problem with my 1Million users? Well, If I ever had one million users, I’ll be happy to deal with these performance issues 🙂

Continue Reading

Where’s my Java reflection?, Part II

Just to give the final implementation started in “Where’s my Java reflection“, here it goes the implementation of the generator for the method bindErrors (check last post “Where’s my Java reflection” to get into context):

private void composeBindErrorsMethod(TreeLogger logger,
			SourceWriter sourceWriter, TypeOracle typeOracle) {

		sourceWriter.println("public void bindErrors("
				+ parameterizedType.getQualifiedSourceName()
				+ " object, Map<String, List<String>> errors) {");

		// Get the fields declared in the parameterized type
		JField[] fields = parameterizedType.getFields();
		for (JField field : fields) {

			JClassType classType = field.getType().isClass();
			if (classType != null) {

				JClassType erroableType = typeOracle.findType(Errorable.class
						.getName());

				if (classType.isAssignableTo(erroableType)) {

					sourceWriter.println("if (errors.containsKey(\""
							+ field.getName() + "\")){");
					sourceWriter.println("object." + field.getName()
							+ ".setErrors(errors.get(\"" + field.getName()
							+ "\"));");
					sourceWriter.println("}");

				}
			}

		}
		sourceWriter.println("}");

Again, hope it helps anyone.

Continue Reading

Where’s my Java reflection?

Some people like it, others don’t. I like it, it’s so cool to make generic code, but as I ‘ve been experimenting with GTW to know it’s capabilities I found that GWT does not support Reflection. It uses instead a mechanism called Deffered Binding to overcome the lack of reflection.

When doing some kind of framework code with GWT, soon you’ll realize that you need reflection, as I did. Bad luck, you’ll have to dig into the underground features of GWT, namely deferred bindings and generators. You can learn the theoretical traits of Deferred Bindings in the documentation: http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsDeferred.html

Let me explain my scenario.

Continue Reading

Set focus on first input of a form

Isn’t annoying when you open a web page with a form and then have to click on the first input to start entering our data?

Well, it’s so easy to make this automatically with Javascript and JQuery

$("input:visible:enabled:first").focus();
Continue Reading

Tenham cuidado com o que partilham nas redes Sociais

Há uns dias atrás vi os meus streams do Facebook, Twitter e Buzz cheios de mensagens acerca de subscrições que fiz a alguns canais do Youtube. Acredito que para quem viu esse fluxo de mensagens foi um grande desprazer. Também foi para mim porque quando integrei estas contas (Youtube, Buzz, Twitter e Facebook) não pensei muito no assunto e devia-me ter precavido destas situações.

floodPior ainda, é que algumas das mensagens estavam duplicadas (Português e Inglês), como podem ver ali na imagem à esquerda.

Mas há quem faça pior. Há quem insista em partilhar tudo nas redes sociais. Por vezes parece que estou a ver a caixa de entrada do email de algumas pessoas, se me enviarem o número do cartão de crédito agradecia 🙂

No Google Buzz, que estou a ponderar desactivar, recebi a seguinte mensagem do stream de alguém:

Alguém quer lhe conhecer no Badoo!

Outra pessoa por perto quer lhe conhecer. Vá até o Badoo e veja se a atração é mútua. Decida quem você quer conhecer!

http://ping.fm/—–

Obrigado,
A Equipe Badoo

Esta é uma mensagem de envio somente. Respostas a esta mensagem não são monitoradas ou respondidas.
Você recebeu esta mensagem como um usuário registrado no ,
para controlar que emails você recebe, por favor, modifique as suas configurações:
http://ping.fm/—-

WTF? Então só para passar o tempo, segui o primeiro link e qual é a minha surpresa que estava agora na posse de uma conta desse serviço (Badoo), com acesso à conta por completo… pena não se algo que me interessasse mais 🙂

Já não é a primeira vez que isto me acontece. Da última vez foi alguém, com o mesmo nome que eu e provavelmente com um endereço de email muito parecido, que se enganou a introduzir o email no Hi5 e lá fiquei com acesso completo à conta do rapaz…

Se quiserem dar acesso às vossas contas de serviços de redes sociais e outros, utilizem um serviço que publique a vossa caixa de correio no stream do Buzz e outros streams.

Ficam avisados 🙂

Continue Reading