REST fácil com RESTEasy

RESTEasy é um projeto da JBoss que provê vários frameworks que ajudam no desenvolvimento de web services RESTful e aplicações Java RESTful. Ele implementa a especificação JAX-RS (JSR-311), que provê uma Java API para serviços web RESTful. RESTEasy é uma portátil implementação que nos permite executá-lo em qualquer contêiner Servlet.

Características:

  •  Implementação JAX-RS;
  •  Portátil a qualquer servidor de aplicação que executa o JDK 5 ou superior;
  •  Servidor embutido para testes JUnit;
  •  Integração com EJB e Spring;
  •  Provê um framework que torna a escrita de clientes HTTP fácil;
RESTEasy facilita o desenvolvimento de serviços REST porque abstrai tarefas como controle de processamento das URIs, validações das mesmas e o encaminhamento correto das operações. Assim o desenvolvedor se foca basicamente no desenvolvimento dos serviços. 
 
Download >>aqui<<

Comentários

HTTP Client para Eclipse (HTTP4E)

HTTP4E é um plugin visual para o Eclipse, muito útil para o desenvolvimento Web, Web Services (SOAP e REST), que permite chamadas HTTP diretamente do Eclipse, fornecendo alto ganho no desenvolvimento e teste de aplicações.

Version: 1.2.2
Support Eclipse Version: 3.2, 3.3, 3.4
License: Free CPL
Development Status: Production/Stable
Company: roussev.org

Mais detalhes

Mais informações sobre a ferramenta e instalação >>aqui<<.

Enjoy!

Comentários

Fórmula Head First

A série de livros Head First é uma das mais conhecidas e indicadas para desenvolvedores iniciantes/avançados Java. Os autores abordam os assuntos de uma forma simples, divertida e altamente didática, prendendo a atenção do leitor. O uso de imagens, análises reais e os exercícios facilitam na fixação do conteúdo estudado.

Retirei a “fórmula” do site:

The Head First Formula

We know what you’re thinking.

    “How can this be a serious book?”
    “What’s with all the graphics?”
    “Can I actually learn it this way?”

And we know what your brain is thinking.

Your brain craves novelty. It’s always searching, scanning, waiting for something unusual. It was built that way, and it helps you stay alive.

So what does your brain do with all the routine, ordinary, normal things you encounter? Everything it can to stop them from interfering with the brain’s real job—recording things that matter. It doesn’t bother saving the boring things; they never make it past the “this is obviously not important” filter.

How does your brain know what’s important? Suppose you’re out for a day hike and a tiger jumps in front of you, what happens inside your head and body?

Neurons fire. Emotions crank up. Chemicals surge.

And that’s how your brain knows…

This must be important! Don’t forget it!

But imagine you’re at home, or in a library. It’s a safe, warm, tiger-free zone. You’re studying. Getting ready for an exam. Or trying to learn some tough technical topic your boss thinks will take a week, ten days at the most.

Just one problem. Your brain’s trying to do you a big favor. It’s trying to make sure that this obviously non-important content doesn’t clutter up scarce resources. Resources that are better spent storing the really big things. Like tigers. Like the danger of fire. Like how you should never have posted those “party” photos on your Facebook page.

And there’s no simple way to tell your brain, “Hey brain, thank you very much, but no matter how dull this book is, and how little I’m registering on the emotional Richter scale right now, I really do want you to keep this stuff around.”

Metacognition: thinking about thinking

If you really want to learn, and you want to learn more quickly and more deeply, pay attention to how you pay attention. Think about how you think. Learn how you learn. Most of us did not take courses on metacognition or learning theory when we were growing up. We were expected to learn, but rarely taught to learn.

But we assume that if you’re holding a Head First book, you really want to learn what’s inside it. And you probably don’t want to spend a lot of time. If you want to use what you read in this book, you need to remember what you read. And for that, you’ve got to understand it. To get the most from this book, or any book or learning experience, take responsibility for your brain. Your brain on this content.

The trick is to get your brain to see the new material you’re learning as Really Important. Crucial to your well-being. As important as a tiger. Otherwise, you’re in for a constant battle, with your brain doing its best to keep the new content from sticking.

So just how DO you get your brain to treat the subject like it was a hungry tiger?

There’s the slow, tedious way, or the faster, more effective way. The slow way is about sheer repetition. You obviously know that you are able to learn and remember even the dullest of topics if you keep pounding the same thing into your brain. With enough repetition, your brain says, “This doesn’t feel important to him, but he keeps looking at the same thing over and over and over, so I suppose it must be.”

The faster way is to do anything that increases brain activity, especially different types of brain activity. The things on the previous page are a big part of the solution, and they’re all things that have been proven to help your brain work in your favor. For example, studies show that putting words within the pictures they describe (as opposed to somewhere else in the page, like a caption or in the body text) causes your brain to try to makes sense of how the words and picture relate, and this causes more neurons to fire. More neurons firing = more chances for your brain to get that this is something worth paying attention to, and possibly recording.

A conversational style helps because people tend to pay more attention when they perceive that they’re in a conversation, since they’re expected to follow along and hold up their end. The amazing thing is, your brain doesn’t necessarily care that the “conversation” is between you and a book! On the other hand, if the writing style is formal and dry, your brain perceives it the same way you experience being lectured to while sitting in a roomful of passive attendees. No need to stay awake. But pictures and conversational style are just the beginning.

Here’s what we do:

We use pictures, because your brain is tuned for visuals, not text. As far as your brain’s concerned, a picture really is worth a thousand words. And when text and pictures work together, we embedded the text in the pictures because your brain works more effectively when the text is within the thing the text refers to, as opposed to in a caption or buried in the text somewhere.

We use redundancy, saying the same thing in different ways and with different media types, and multiple senses, to increase the chance that the content gets coded into more than one area of your brain.

We use concepts and pictures in unexpected ways because your brain is tuned for novelty, and we use pictures and ideas with at least some emotional content, because your brain is tuned to pay attention to the biochemistry of emotions. That which causes you to feel something is more likely to be remembered, even if that feeling is nothing more than a little humor, surprise, or interest.

We use a personalized, conversational style, because your brain is tuned to pay more attention when it believes you’re in a conversation than if it thinks you’re passively listening to a presentation. Your brain does this even when you’re reading.

We include many activities, because your brain is tuned to learn and remember more when you do things than when you read about things. And we make the exercises challenging-yet-do-able, because that’s what most people prefer.

We use multiple learning styles, because you might prefer step-by-step procedures, while someone else wants to understand the big picture first, and someone else just wants to see an example. But regardless of your own learning preference, everyone benefits from seeing the same content represented in multiple ways.

We include content for both sides of your brain, because the more of your brain you engage, the more likely you are to learn and remember, and the longer you can stay focused. Since working one side of the brain often means giving the other side a chance to rest, you can be more productive at learning for a longer period of time.

And we include stories and exercises that present more than one point of view, because your brain is tuned to learn more deeply when it’s forced to make evaluations and judgments.

We include challenges, with exercises, and by asking questions that don’t always have a straight answer, because your brain is tuned to learn and remember when it has to work at something. Think about it—you can’t get your body in shape just by watching people at the gym. But we did our best to make sure that when you’re working hard, it’s on the right things. That you’re not spending one extra dendrite processing a hard-to-understand example, or parsing difficult, jargon-laden, or overly terse text.

We use people. In stories, examples, pictures, etc., because, well, because you’re a person. And your brain pays more attention to people than it does to things.

Read me: Other stuff you should know

This is a learning experience, not a reference book. We deliberately stripped out everything that might get in the way of learning whatever it is we’re working on at that point in the book. And the first time through, you need to begin at the beginning, because the book makes assumptions about what you’ve already seen and learned.

The activities are NOT optional.

The exercises and activities are not add-ons; they’re part of the core content of the book. Some of them are to help with memory, some for understanding, and some to help you apply what you’ve learned. Don’t skip the written problems. The pool puzzles are the only things you don’t have to do, but they’re good for giving your brain a chance to think about twisty little logic puzzles.

The redundancy is intentional and important.

One distinct difference in a Head First book is that we want you to really get it. And we want you to finish the book remembering what you’ve learned. Most reference books don’t have retention and recall as a goal, but this book is about learning, so you’ll see some of the same concepts come up more than once.

Do all the exercises!

The one big assumption that we made when we wrote this book is that you want to learn what’s inside it. So we know you want to get your hands dirty right away, and dig right into the code. We gave you a lot of opportunities to sharpen your skills by putting exercises in every chapter. We’ve labeled some of them “Do this!”—when you see that, it means that we’ll walk you through all of the steps to solve a particular problem. But when you see the Exercise logo with the running shoes, then we’ve left a big portion of the problem up to you to solve, and we gave you the solution that we came up with. Don’t be afraid to peek at the solution—it’s not cheating! But you’ll learn the most if you try to solve the problem first.

The “Brain Power” exercises don’t have answers.

For some of them, there is no right answer, and for others, part of the learning experience of the Brain Power activities is for you to decide if and when your answers are right. In some of the Brain Power exercises you will find hints to point you in the right direction.

Comentários

Sun Tech Days 2008 - Primeira parada no Brasil

Em setembro, começa um novo tour de um dos maiores eventos de desenvolvedores do mundo: o Sun Tech Days, que vai atingir 13 cidades no mundo todo!

A primeira parada será no Brasil, na cidade de São Paulo.

Se você desenvolve em Java, Scripting, MySQL, OpenSolaris, NetBeans ou RIA’s, a próxima geração de aplicações, esse evento é para você!

No Sun Tech Days Brasil, que já está em sua sexta edição, você vai conhecer de perto os principais experts do mundo, além de aprender, compartilhar informações, interagir, conhecer outros desenvolvedores e, principalmente, participar. Afinal, deixamos para trás a Era da Informação e mergulhamos na Era da Participação, onde todos trazem inovações, trocam conhecimentos e inspiram pensamentos!

Agenda

Sun Tech Days + Deep Dive NetBeans + University Day
29 e 30 de setembro + 01 de outubro
Local: Amcham - Rua da Paz, 1431 - Chácara Santo Antônio - São Paulo - SP

Link para inscrição

Sun Tech Days

29 de Setembro, das 09:00h às 20:00h
30 de Setembro, das 09:00h às 19:00h

Valores
até 09/09 - R$ 110,00 via boleto bancário
até 24/09 - R$ 150,00 via boleto bancário
após 25/09 somente no local - R$ 200,00 em dinheiro

Mais informações aqui

Comentários

Effective Java 2 Second Edition

Foi lançada a segunda versão do livro Effective Java de Joshua Bloch, que além de trabalhar atualmente no Google é um dos responsáveis por importantes features do Java como o package java.math, o mecanismo de assert e os generics.
O livro foi atualizado para a versão 6 do Java, e tem como objetivo explicar boas práticas no desenvolvimento de software com Java.
Lí a maior parte da primeira versão do livro e não vejo a hora de começar a leitura desta nova versão que conta com novas características como enum, foreach, annotations, entre outras adicionadas ao Java 6.
É o livro perfeito para o desenvolvedor Java que não gosta de programar de qualquer jeito, e está sempre ligado em boas práticas de desenvolvimento.

É na minha opinião, obrigatório para todo bom desenvolvedor Java.

Enjoy!

Comentários

Palestra sobre SOA com Burr Sutter no TDC 2008

Além da presença de Ed Burns, que é um dos maiores especialistas de JavaServer Faces e Ajax do mundo, e de Reza Rahman membro do expert group de EBJ 3.1 e co-autor do livro “EJB3 in Action”, o evento TDC 2008 conta com a presença de mais um ilustre palestrante que falará sobre SOA, o nome dele é Burr Sutter.

Visitei o blog do cara e fiquei surpreendido com sua mini-bio:

Burr Sutter - Software Architect
“Burr Sutter is a current Sun Java Champion, President of the Atlanta Java Users Group and President of the Atlanta Chapter of the International Association of Software Architects. He has over 15 years of software design and development experience along with numerous published articles, book chapters and developer conference speaking engagements. He is presently employed at JBoss, a division of Red Hat.”

Encontro vocês lá!

Comentários

XML e Java com XStream

Pra quem trabalha com Web Services sabe a importância do uso do XML em seu projeto, pois o mapeamento Java para XML e vice-versa é uma rotina frequente.
XStream é uma biblioteca que oferece a serialização de Java –> XML e de XML –> Java. Além de ser muito simples de ser utilizada, é muito poderosa.

Exemplo

Vamos criar uma classe para teste. Neste exemplo criarei uma classe Carro que HAS-A Motor. Usei a agregação para que o exemplo fique um pouco mais incrementado do que o normal.

Classe Carro.java:

Classe Motor.java

Vamos criar a classe para testar nosso exemplo, mas antes vamos configurar o nosso ambiente com o XStream:

Configurando o ambiente

1) Baixe a biblioteca aqui e descompacte
2) Vamos precisar de dois .jars que estão na pasta xstream-1.3/lib:

  • xstream-1.3.jar
  • xpp3_min-1.1.4c.jar

3) Adicione os .jar no seu classpath e pronto

Neste ponto já podemos importar a classe XStream, então vamos para o teste:

Explicando o código:

  • Linha 10: Uma instância de XStream foi criada
  • Linha 12 à 14: Criei um carro e defini alguns valores
  • Linha 16 à 18: Criei um motor e defini algunas valores
  • Linha 19: Coloquei o motor no carro
  • Linha 21: Criei uma lista denominada carros
  • Linha 22: Adicionei a carro criado na lista carros
  • Linha 24: Criei uma String que guardará o resultado Java –> XML, passando a lista como argumento
  • Linha 27: Impressão da String com o resultado da conversão

Saída:

Simples, não?! Utilizei um exemplo básico para ilustrar a facilidade que a biblioteca nos oferece, e caso queiram saber mais sobre ela, visitem o site.

Até o próximo post!

Comentários

JUDE/Community 5.3 Released

JUDE é uma IDE desenvolvida em Java, e é usada para a modelagem de dados UML de forma descomplicada, rápida e intuitiva.

A versão Community (free) oferece o suporte aos seguintes diagramas:

  • Class Diagram
  • Use Case Diagram
  • Statechart Diagram
  • Activity Diagram
  • Sequence Diagram
  • Collaboration Diagram
  • Component Diagram
  • Deployment Diagram

Depois de feita a modelagem do sistema, é possível fazer a exportação do arquivo no formato Java, HTML ou em forma de imagem: PNG ou JPEG.

A versão Professional 5.3 Released fornece suporte a tipos primitivos C# e exportação em código C#.

Eu sempre usei JUDE para a modelagem de dados e recomendo a todos. O fato de oferecer uma versão free ajuda muito, pois encontramos várias ferramentas comerciais para a modelagem UML com preços altíssimos, e que muitas vezes deixam a desejar. JUDE é leve e fácil de usar. Indicado a todos que trabalham com modelagem de dados ou que tenham a necessidade de utilizar uma ferramenta de modelagem para seus projetos.

Até o próximo post!

Comentários

OpenXava 3

OpenXava é um JPA Application Engine que permite o desenvolvimento rápido e simples de aplicações J2EE.

Utiliza o padrão MVC, o desenvolver precisa criar somente o Model, pois o Controller é reusável e a View é gerada automaticamente.

Para desenvolver uma aplicação, a pessoa deve criar POJOs com anotações JPA e o resto é por conta do OpenXava.

Exemplo

Vou descrever os passos para rodar um dos projetos de teste que acompanha o pacote que iremos baixar. O projeto se chama MySchool.

  • Descompacte em seu diretório favorito.
  • Apontar o Eclipse para o workspace do OpenXava: File -> Switch Workspace -> diretorioOndeVoceDescompactou/openxava-3.0.2/workspace
  • Executar o Tomcat no terminal:

1) cd /openxava-3.0.2/tomcat
2) ./start-tomcat.sh

  • Adicionar a Visualização Ant no Eclipse: Window -> Show View ->Ant
  • Arraste o arquivo build.xml do Projeto MySchool para a visualização Ant
  • Executar o target ant MySchool.deployWar
  • Aguarde o BUILD SUCCESSFUL no console do Eclipse

Ele é indicado para iniciantes e até experts que desejam produtividade.

Até o próximo!

Comentários

Subversion 1.5 lançado

Subversion

O Subversion é um sistema de controle de versões livre/open-source que foi lançado para substituir o ultrapassado CVS.
Ele faz a gerência de arquivos e diretórios, funcionando como um sistemas de arquivos. A diferença é que ele grava as modificações feitas, permitindo que os dados sejam recuperados posteriormente.

Características

  • Controle de versão de diretórios
  • Verdadeiro histórico de versão
  • Commits atômicos
  • Controle de versão de metadados
  • Escolha de camadas de rede
  • Manipulação consistente de dados
  • Branching e tagging eficientes
  • Hackabilidade

Alguns ambientes de integração: Eclipse, JDeveloper, NetBeans, VisualStudio.

O Subversion utiliza a política copia-modifica-resolve, mas nas versões atuais há a possibilidade de travamento de arquivos, pois a mesclagem de alguns tipos de arquivos como binários, imagens, arquivos compactados, entre outros, apresentam uma dificuldade maior na momento do merge.

Na versão 1.5 algumas novidades são apresentadas, mas a que mais vai ajudar o programador é o rastreamento automático de Merge, pois não haverá a necessidade de fazer a mesclagem do código modificado “na unha”, como ocorria nas versões anteriores.

Benefícios

  • Melhoria na qualidade do processo de desenvolvimento;
  • Rapidez em modificações
  • Redução dos custos de modificações
  • Capacidade de conduzir várias versões do software
  • Capacidade de recuperar versões anteriores

Até a próxima!

Comentários

« Entradas anteriores