RSS .92| RSS 2.0| ATOM 0.3
  • Home
  • Artigos
  • Publicações
  • Apresentações
  • Interviews
  • Livros
  • Contact
  • About
  • JSR-311 finally approved!

    September 24th, 2008

    Yesterday the JSR-311 (Java API for RESTFul Web Services - JAX-RS) was finally approved!

    I’m using Jersey (the JSR’s reference implementation) for more than 6 months and I was anxious to have the specification approved.

    In my team we’re currently using Jersey 0.7 in production, and were waiting for the JSR to be approved to analyse the final version of its implementations. Now we’ll wait for both Jersey and JBoss RESTEasy to release their final versions and we’ll analyse both to see which one we’ll use in our RESTFul services.

    If anyone wants to give me good reasons to use either one of the implementations, now it’s the perfect time! I’m hearing… :)


    RESTFul services registry

    September 8th, 2008

    Today my team started a new Sprint, with several very interesting technical stories. We are progressively migrating an architecture that uses EJB 2.1 for client-server communication and also for transaction control. Our new architecture uses RESTFul services (currently with Jersey 0.7) for communication and Spring + Ibatis underneath.

    One of the main issues with the old architecture is the tight coupling between the server and the clients. The way it was designed, our server platform is limited by the oldest client’s platform.  To have more flexibility and loose coupling between server and clients, we decided to have an XML contract in the communication.

    In this Sprint we must finish the implementation of a Java client to be distributed to the client applications. We have some optimization and refactoring tasks for this Sprint, and one of them includes a RESTFul registry. We don’t want the clients to have our URIs configured via properties files. This approach limits our flexibility to manage URIs, so a different approach is desirable.

    Our client will access a repository to ASK FOR the URI corresponding to a given service AND version. That means: the client willing to access the login service will ask the repository for the URI of this service, in the client’s version. The client could ask for /repository/login/v2.0 and then receive back the URI http://login.globo.com/login/v2.0.

    We could have several different versions of the same services, each of them with different contracts. Introducing the repository as an extra layer of indirection, we also have the flexibility to take down several server machines for a while and even update URIs if desired (although that’s unlikely).

    I checked Mule Galaxy and WSO2 Registry, but unfortunately they don’t give me what I need. They’re both open source registries, but they index SOAP services and some other things, but not RESTFul URIs. They offer a REST API to interact with their registries (unlike UDDI, which uses SOAP), but don’t index RESTFul URIs at this moment.

    After this analysis of both, i decided to implement my own RESTFul registry. It shouldn’t be too sofisticated for this first release, but since it’s a frequent need in my team, I’m probably going to take some off-time to develop a nice registry that might be useful for a wider range of applications. My goal with this post is to gather some requirements for this registry and also its client. Features that would be useful for other people too.

    The initial set of requirements that I wanna deliver in this Sprint is:

    • Must have a RESTFul API to search for services
    • Should be possible to browse published services with a web browser (even IE, if you call it a browser)
    • Ajax clients should be able to access the registry easily
    • Java client must run on JDK 1.4 and above
    • Java client should require as few libraries as possible
    • Registry should access the database through a JDBC datasource
    • Offer an authenticated user interface to publish the services (probably with Java EE authentication)

    An extra list of desirable features (not for this Sprint) is:

    • Import service URIs from WADL document
    • Allow database access without a JDBC datasource
    • Show history of modifications in the registry
    • Registry should be distributed as .war
    • Offer other ways of authentication

    Well, that’s the first ideas that come to my mind. My intention is to implement a nice registry and offer it for everyone to use it. If you think of some other features that would be nice in the registry, please let me know. The idea of this post is to be an asynchronous brainstorm, so please help! :)


    Netbeans growing stronger

    May 12th, 2008

    During several years I’ve been a pretty happy Eclipse user, rarely feeling the need to use anything else. We know there are plugins for many many things, and a lot of development tools are Eclipse-based right now. The editor is awesome, and so are the refactoring tools. The support for web app development is also very nice. Eclipse supports a wide set of frameworks and technologies, and it’s not only aimed at Java development.

    Why would someone even look at anything else, having such a great tool? Well, it turns out that our field is evolving really fast, and it’s very hard to follow this current pace, even for the most dedicated and passionate ones. Currently there are several technologies evolving very fast, and they are meaningful to a lot of enterprise developers. The rise of the JVM’s dynamic languages is crystal clear. Strong is also the growth of RESTFul web services. I’m personally very interested in both fields.

    I’m currently using REST (lately with Jersey) for a lot of integrations between applications. The power it gives me is really nice, and I’m improving my developments each new month. I have also studied Groovy/Grails recently and really liked it. I wanna try JRuby on Rails sometime in the next weeks, to see what it offers and check how it compares to Grails. If you’re a Java enterprise developer, I’m sure you’re following the growth of these nitty things.

    But where does Netbeans enter this talk? Well, Netbeans is doing a great job supporting these new technologies, and it’s way ahead of Eclipse in this field right now. Have you seen how easily you can develop RESTFul web services with Netbeans 6.1? Jersey support is great, very productive. The support for JRuby on Rails and Grails is also present, in a much more advanced state than Eclipse’s. Netbeans is doing a much better job than Eclipse regarding Web Services and JVM languages right now.

    Swing development in Netbeans is very nice since version 5.0 (with the release of Matisse), and developing for mobile devices is also easier in Netbeans. Currently I don’t develop swing nor mobile applications, so this doesn’t really affect me.

    However, I develop many RESTFul web services. And I wanna use more and more the JVM’s dynamic languages. Ignoring Netbeans is not a clever idea right now.

    I still find Eclipse’s interface and editor much better than Netbeans’s. I also know a lot of Eclipse’s shortcuts and know very few in Netbeans. SWT is also faster than Swing, so Eclipse is faster than Netbeans. But considering what I said, I’m leaning towards the use of both IDEs at the same time. Since our machines are now much better equipped with RAM, I can have them open at the same time and also a couple of servers, with no memory shortage.

    My Eclipse days are definitely not over, but now he’s gonna divide my attention with Netbeans :) I hope I can become as productive with Netbeans as I am with Eclipse, even if it takes a few weeks. My first wish would be the Eclipse’s Quick Fix (Ctrl + 1) avaiable in Netbeans. Even without it, I’m sure my usage of Netbeans will certainly grow, and think this competition between the IDEs is very good for us. Let Eclipse Ganymede come!


    Jersey meets Abdera

    February 6th, 2008

    Talvez os dois mais promissores projetos atualmente sendo desenvolvidos na área de web services Rest são o Apache Abdera e o Jersey. O Apache Abdera oferece uma API para manipulação de conteúdo no formato Atom, e é bastante útil para implementações baseadas no Atom Publishing Protocol. Já o Jersey é a implementação de referência da JSR-311, que mencionei num post recente aqui no blog.

    Os 2 projetos são complementares, já que as funcionalidades de ambos não tem muitas interseções. Ontem o Marc Hadley, um dos principais desenvolvedores do Jersey postou sobre um desenvolvimento que ele está fazendo, usando o Jersey e o Abdera em um projeto de web services Restful. No post do Marc Hadley ele menciona que utilizou os recursos HTTP do Jersey (como mapeamento de URIs em classes e métodos e a capacidade de manipular diversos content-types) juntamente com as funcionalidades do Abdera de manipulação de recursos Atom.

    Esta iniciativa foi muito bem recebida pelo James Snell e pelo Dan Diephouse (fundador do XFire), que são os principais desenvolvedores do Apache Abdera. O desenvolvimento destes dois projetos vem trazendo enorme amadurecimento aos web services REST e hoje já é possível desenvolver web services neste formato com grande produtividade e poder.

    Claro que os projetos ainda estão em um estágio intermediário de desenvolvimento, mas é deles que virá a adoção mainstream com maturidade desta linha de serviços. Estou acompanhando continuamente o que está sendo feito nesta área, e o que já pude ver até agora é fascinante.

    A propósito, os dois projetos são open source e os principais envolvidos fazem parte de empresas como a IBM, Sun, Mulesource, entre outras. O desenvolvimento de software open source é hoje em dia a principal forma de desenvolvimento da vanguarda da tecnologia mundial. As empresas já perceberam o sucesso do movimento e estão apoiando firmemente o mesmo. Não posso deixar de registrar minha profunda satisfação com isso. :)


    JSR-311: Java API for RESTful Web Services

    January 31st, 2008

    Eu estou atualmente implementando alguns web services Restful, e estou avaliando opções para alguns pedaços do desenvolvimento. Eu já sabia que existia uma JSR para web services REST, mas ainda não tinha lido a mesma.Agora há pouco li a JSR-311, que definirá padrões de implementação Java para uma API Rest, do lado do servidor. A parte de implementação de clientes será tratada em outra(s) JSR(s) .

    Esta JSR é bastante interessante, e já pude ver nela o tratamento de coisas muito úteis. De principal destaque para mim está a abordagem de mapeamento de URIs em recursos e métodos e a questão do mapeamento de classes Java para dados com diversos content-types.

    Em relação às URIs, há a definição de regras para mapear URIs em classes e métodos, instanciando as classes necessárias e invocando os métodos adequados. Suponha por exemplo uma requisicao HTTP PUT na URI /usuario/16728/produto/228/configuracao/. Em um protocolo definido por mim, isto representaria uma atualização nas configurações do Produto 228 para o Usuário 16728. Um ser humano consegue entender isso sem tantos problemas, mas uma implementação manual destes mapeamentos e o parsing dos parâmetros podem ser coisas bem trabalhosas. A JSR 311 utiliza várias annotations para conseguir definir o encadeamento de classes e métodos a partir da URI utilizada, e isto faz com que você consiga desenvolver em Java normalmente e ter as suas classes instanciadas e invocadas com URIs tão flexíveis quanto você queira. Muito bom ter isso como recurso, pois implementar na mão é bem trabalhoso.

    Outra coisa muito interessante é a maneira de mapear classes Java para diversos content-types. Isso é algo fundamental para uma implementação Restful com bastante flexibilidade E possivelmente alta performance. A idéia por trás disso é que o servidor recebe uma requisição de um cliente e verifica quais são os content-types que o cliente aceita. Com base nestas informações, o servidor escolhe a forma que irá utilizar para transmitir os dados.

    Suponha por exemplo que uma aplicação PHP está se comunicando com seu servidor, e ele lhe informa que aceita os content-types text/plain, text/xml e application/json. O servidor pode escolher qual formato utilizar para o envio e possivelmente o envio com formato json facilita bastante a aplicação PHP. Este mesmo servidor pode receber requisições de uma outra aplicação Java, que preferencialmente receberá do seu servidor um stream binário, que terá a melhor performance de todas as opções.

    O uso desta abordagem dos mapeamentos em content-types permite que sua aplicação tenha ao mesmo tempo alta interoperabilidade e alta performance. Você conseguirá se comunicar com várias plataformas e aplicações diferentes, e continuará tendo a opção de alta performance, caso seja uma aplicação da mesma plataforma. Você não consegue isso com web services WS-*. Eles não têm tamanha flexibilidade.

    O meu próximo passo agora será analisar com detalhes o Jersey, a implementação de referência desta JSR. A especificação em si ainda está um tanto crua, pois ainda é um early draft. Já pude ver vários pontos interessantes, mas a definição ainda está sujeita a muitas modificações. Vou avaliar agora o que o Jersey já oferece e torcer para que ele já tenha componentes fáceis de usar e flexíveis. A proposta dele é excelente, vamos ver se a implementação consegue oferecer estes recursos sem amarrar muito as decisões de projeto.


  • rheumatoid arthritis medications
  • medicine for pets
  • natural treatments for insomnia
  • sleep disorder treatment
  • anti vomiting
  • blood sugars
  • generic reglan
  • pharmacy no prescription
  • drugs for sale
  • muscles human body
  • anabolic creatine
  • online diet meds
  • acne cure pills
  • cialis benefits
  • metronidazole dose
  • women body building
  • otc claritin
  • cetirizine drug
  • cialis 5mg
  • baby acne
  • lipitor use
  • throat gonorrhea
  • cheap phentermine without a prescription
  • how does viagra work?
  • valium high
  • chest pain symptoms
  • prescription drug store online
  • cheap pain meds
  • acne face medication
  • pet health websites
  • anxiety order
  • what is premature ejaculation
  • dog skin
  • hair loss drug
  • online paxil
  • coupon zantac
  • effects of folic acid
  • buy canada drugs
  • curing premature ejaculation
  • carisoprodol cheapest
  • side effects of cancer treatments
  • women heart attack
  • lowest price generic viagra
  • pet supplies plus
  • vitamin supplement ratings
  • diabetes treatment
  • zoloft discount
  • coupon claritin
  • women insomnia
  • buy aciphex
  • cialis on line
  • treatment for hepatitis b
  • order metformin online
  • cialis cheap cialis online
  • claritin allergies
  • mexico pharmacies
  • how to lower blood pressure
  • diclofenac tablet
  • ordering medications online
  • cancer drugs
  • diflucan purchase
  • how to get birth control
  • dog skin infection
  • lowering blood pressure naturally
  • clonazepam pharma
  • health products women
  • buy cialis
  • soma or valium
  • pre diabetes
  • side effects blood pressure tablets
  • discount pain relief
  • dog med
  • osteoporosis calcium drug
  • tramadol without a prescription
  • zoloft drug
  • treatment high blood pressure
  • sildenafil 100mg
  • discount herbals and vitamins
  • aricept generic
  • asthma information
  • bupropion anxiety
  • free acai
  • top hair loss
  • yeast diflucan
  • health care for dogs
  • green tea products
  • cheapest place to buy phentermine
  • canada pharmacy drug perscription
  • high cholesterol treatment
  • viagra free trial
  • cancer cure
  • treatment to stop smoking
  • arthritis pain medicine
  • buy vardenafil online
  • generic viagra generic
  • vitamin list
  • discount soma online
  • facial skin care products
  • buy vitamin supplement
  • cialis alternative
  • viagra for cheap
  • sildenafil
  • online diet drugs
  • online drug
  • benicar tablets
  • purchase medicine on line
  • what is ambien
  • online prescription drug
  • hair loss disease
  • medicine that prevents blood clots
  • antifungal drug
  • medicine for vomiting
  • how to take a beta-blocker
  • san diego soma
  • vascular edema
  • acne skin care treatment products
  • how does viagra work?
  • reduce blood pressure
  • phentermine with no prescription
  • chlamydia treatment online
  • buy levitra on-line
  • beta blocker uses
  • viagra fedex
  • giving cats pills
  • menopause natural treatment
  • oral fluconazole
  • stop smoking today
  • prescription pain medicines
  • menopause natural treatment
  • fda avandia
  • actonel dosage
  • haldol medication
  • how to burn fat
  • all natural antibiotics
  • healthy dog food recipe
  • reduce swelling methods
  • prescription drugs on line
  • drugs use in arthritis
  • weight loss meds on line
  • cheap weight loss
  • pain in chest
  • chlamydia treatment
  • acai cleanse
  • online pharmacies with no prescription needed
  • cancer medications
  • clomid dosage
  • generic pravachol
  • what pills look like phentermine
  • dosage of viagra
  • how to prevent pregnancy
  • treatment for cancer
  • buy generic cialis
  • when is viagra needed
  • no hangover
  • water pills
  • what is generic viagra
  • antianxiety
  • buy asthma meds
  • acyclovir information
  • bronchitis pregnancy
  • treatment for alzheimer's disease
  • medicine chlamydia
  • mail order medicine
  • new treatments for lung diseases
  • cheap pain pills
  • constipation large stool
  • hand pain
  • stopping hair loss
  • antibiotics diarrhea
  • medication without prescription
  • help for infertility
  • weight loss diet
  • body building diets
  • atenolol interaction
  • medical heart failure
  • small dog products
  • stress pills
  • singulair generic
  • what is heart failure
  • new diet pills
  • discount viagra generic
  • order alli
  • treatment for infant diarrhea
  • buy prescription medication online
  • insomnia disorders
  • medical treatments for acne
  • skin disorders in cats
  • zantac medication
  • antibiotics bactrim
  • high blood calcium levels
  • vitamin supplement store
  • jelly kamagra
  • stress drug
  • health products for men
  • health supplement woman
  • us online pharmacy
  • energy saving products
  • about zocor
  • high amount of acid in blood
  • malaria medicines
  • Bruno Pereira is Digg proof thanks to caching by WP Super Cache!