<?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/"
	>

<channel>
	<title>Bruno Pereira &#187; apache</title>
	<atom:link href="http://brunopereira.org/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://brunopereira.org</link>
	<description>Open source, Java, web, python, client-side e outros hobbies :)</description>
	<lastBuildDate>Thu, 20 Oct 2011 00:47:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Acelerando seu site &#8211; Parte 1: habilitando compressão</title>
		<link>http://brunopereira.org/2010/06/20/acelerando-seu-site-parte-1-habilitando-compressao/</link>
		<comments>http://brunopereira.org/2010/06/20/acelerando-seu-site-parte-1-habilitando-compressao/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 01:21:47 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[otimização]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[caelum]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[mod_deflate]]></category>
		<category><![CDATA[page speed]]></category>
		<category><![CDATA[yslow]]></category>

		<guid isPermaLink="false">http://brunopereira.org/?p=355</guid>
		<description><![CDATA[Recentemente tenho me envolvido bastante com otimização de sites e aplicações web. Fazendo uma pesquisa diversificada em muitos sites nacionais e internacionais, pude constatar que a grande maioria dos sites deixa muito a desejar nos critérios de velocidade/eficiência. As ferramentas mais simples para medir a eficiência das páginas são o Google Page Speed e o [...]]]></description>
			<content:encoded><![CDATA[<p>Recentemente tenho me envolvido bastante com otimização de sites e aplicações web. Fazendo uma pesquisa diversificada em muitos sites nacionais e internacionais, pude constatar que a grande maioria dos sites deixa muito a desejar nos critérios de velocidade/eficiência. As ferramentas mais simples para medir a eficiência das páginas são o <a title="Google Page Speed" href="http://code.google.com/speed/page-speed/" target="_blank">Google Page Speed</a> e o <a title="YSlow" href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a>(do Yahoo). Ambos são extensões do <a title="Firebug" href="http://getfirebug.com/" target="_blank">Firebug</a>, então você precisa primeiro instalá-lo no Firefox.</p>
<p>Para uma referência dos ratings do Page Speed e YSlow, sites com rating acima de 80 podem ser considerados muito bons. É possível chegar até  90 sem configurações muito complicadas. Até hoje, o site com os maiores ratings que já encontrei em toda a internet é o site da <a title="Caelum" href="http://www.caelum.com.br" target="_blank">Caelum</a>. Rodei agora os testes e eles estão c/ 96 no Page Speed e 100 no YSlow. O meu blog está c/ 85 no Page Speed e 84 no YSlow <img src='http://brunopereira.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A maioria das técnicas de otimização é simples de aplicar, e é possível ter ótimos resultados com bem pouco trabalho. Escreverei uma série de posts curtos e objetivos explicando as principais técnicas e mostrando como utilizá-las nas arquiteturas mais comumente usadas.</p>
<h2>Motivação</h2>
<p>Todos os browsers modernos possuem recursos de descompressão de conteúdo, e boa parte dos arquivos servidos em aplicações web podem ser bem comprimidos. Habilitando compressão no servidor o tempo de resposta das páginas diminui, e com isso cai também o tráfego do servidor.</p>
<h2>Como fazer</h2>
<p>O servidor web mais utilizado na internet é o <a title="Apache HTTP Server" href="http://httpd.apache.org/" target="_blank">Apache</a>. Mostrarei inicialmente a configuração somente dele, e caso alguém queira saber também do IIS e nginx, complementarei posteriormente.</p>
<p>Para habilitar a compressão, deve estar ativo <a title="mod_deflate" href="http://httpd.apache.org/docs/2.0/mod/mod_deflate.html" target="_blank">mod_deflate</a>. No Ubuntu você pode verificar os módulos ativos listando o diretório /etc/apache2/mods-enabled.</p>
<p>A opção mais simples de configuração é utilizar a diretiva: <code>SetOutputFilter DEFLATE</code></p>
<p>Esta opção habilita compressão para tudo, no escopo onde for colocada. Podemos habilitar compressão em um virtual host, em um diretório ou até mesmo em todos os arquivos servidos pelo Apache.</p>
<p>Outra opção é habilitar compressão somente para alguns tipos de arquivos, com esta diretiva: <code>AddOutputFilterByType DEFLATE text/html text/plain text/xml</code></p>
<p>Na documentação do mod_deflate há cenários mais complicados, como verificações do browser, manipulação de cabeçalhos HTTP, consumo de conteúdo comprimido, entre outras coisas. Se alguém tiver dúvidas posso ajudar no setup de testes.</p>
<h2>Verificando que funcionou</h2>
<p>Para verificar que a compressão está ativa, podemos utilizar o <a title="Poster" href="https://addons.mozilla.org/en-US/firefox/addon/2691/" target="_blank">Poster</a> para requisitar uma página do site e conferir o cabeçalho Content-Encoding da resposta, conforme imagem abaixo. Se aparecer o encoding gzip, a compressão está ativa.</p>
<p><a href="http://brunopereira.org/wp-content/uploads/2010/06/poster_compressao.png"><img class="alignnone size-full wp-image-360" title="poster_compressao" src="http://brunopereira.org/wp-content/uploads/2010/06/poster_compressao.png" alt="" width="835" height="638" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2010/06/20/acelerando-seu-site-parte-1-habilitando-compressao/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>A importância do open source profissional</title>
		<link>http://brunopereira.org/2009/05/18/a-importancia-do-open-source-profissional/</link>
		<comments>http://brunopereira.org/2009/05/18/a-importancia-do-open-source-profissional/#comments</comments>
		<pubDate>Mon, 18 May 2009 05:28:23 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[spring source]]></category>

		<guid isPermaLink="false">http://brunopereira.org/?p=340</guid>
		<description><![CDATA[Continuando o tema do meu artigo anterior, agora quero falar sobre a importância do open source profissional.
Na última quinta-feira eu fui na palestra do Bruno Borges no RioJUG, sobre Apache Camel. A palestra em si foi bem legal, pois eu já conhecia um pouco do Apache Camel e pude ver algumas coisas a mais. Mas [...]]]></description>
			<content:encoded><![CDATA[<p>Continuando o tema do <a href="http://brunopereira.org/2009/05/18/as-diferentes-culturas-open-source-ubuntu-x-debian/" target="_blank">meu artigo anterior</a>, agora quero falar sobre a importância do open source profissional.</p>
<p>Na última quinta-feira eu fui na palestra do <a href="http://blog.brunoborges.com.br/" target="_blank">Bruno Borges</a> no <a href="http://www.riojug.org" target="_blank">RioJUG</a>, <a href="http://www.riojug.org/blog/?p=79" target="_blank">sobre Apache Camel</a>. A palestra em si foi bem legal, pois eu já conhecia um pouco do <a href="http://camel.apache.org/" target="_blank">Apache Camel</a> e pude ver algumas coisas a mais. Mas o ponto específico que eu quero abordar é um comentário que o Bruno fez, que diverge da minha postura em relação a open source.</p>
<p>Ele comentou que tenta sempre utilizar produtos <a href="http://www.apache.org" target="_blank">Apache</a>, evitando produtos open source que tenham vínculo com alguma empresa, como <a href="http://www.jboss.org/" target="_blank">JBoss</a>, <a href="http://www.springsource.com/" target="_blank">SpringSource</a>, entre outras. Não me recordo do motivo exato, mas a razão principal que ele explicou é o fato da Apache Software Foundation ser uma fundação composta de pessoas, em vez de ser uma empresa com fins comerciais.</p>
<p>Eu tenho uma postura diferente da dele em relação a open source. Eu gosto muito e tenho um respeito enorme pela fundação Apache. Já usei inúmeros produtos Apache e certamente continuarei usando por muito tempo. Entretanto, já usei vários produtos <a href="http://www.jboss.org" target="_blank">JBoss</a> e vários componentes do <a href="http://www.springsource.org/" target="_blank">Spring</a>, e acho muito importante e saudável a existência dessas empresas.</p>
<p>A história do movimento open source tem vários elementos &#8220;românticos&#8221; e &#8220;filosóficos&#8221;, e essa característica ainda é muito presente em várias comunidades hoje em dia. Entretanto, com o crescimento do Linux, Java, Python, Ruby e outras tecnologias, existe hoje um mercado enorme de trabalho e negócios em torno do software livre.</p>
<p>O surgimento desse mercado naturalmente trouxe a participação de muitas empresas que vivem de software livre atualmente. Sei que há pessoas que enxergam open source e capitalismo como coisas opostas, mas na minha opinião essa visão é míope. Open source é um modelo de desenvolvimento de software e oferta de produtos e serviços. A busca do lucro é o que move nossas empresas, e isso não é diferente para quem atua com software livre.</p>
<p>O surgimento das empresas profissionais open source foi importantíssimo para o amadurecimento das tecnologias e dos profissionais. Se o movimento open source continuasse restrito ao meio acadêmico, o nível de competição no mercado de software seria muito menor, e o avanço tecnológico teria sido bem mais lento.</p>
<p>Além disso, minha postura profissional é de tentar sempre entregar os melhores resultados para os clientes e para a empresa em que trabalho. Em algumas situações pode ser mais adequado usar open source, em outras pode ser necessário usar software proprietário. Temos que nos adequar às necessidades dos clientes, em vez de esperar que eles se adeqüem às nossas preferências.</p>
<p>No meu ponto de vista, empresas como JBoss e SpringSource contribuíram e contribuem muito no processo de profissionalização do software livre. A existência delas criou um mercado fortíssimo em torno do software livre, e eu só tenho a agradecer por isso.</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2009/05/18/a-importancia-do-open-source-profissional/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>À procura de uma maneira produtiva de trabalhar com web services SOAP</title>
		<link>http://brunopereira.org/2008/12/08/a-procura-de-uma-maneira-produtiva-de-trabalhar-com-web-services-soap/</link>
		<comments>http://brunopereira.org/2008/12/08/a-procura-de-uma-maneira-produtiva-de-trabalhar-com-web-services-soap/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 00:28:03 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache cxf]]></category>
		<category><![CDATA[aqualogic]]></category>
		<category><![CDATA[axis]]></category>
		<category><![CDATA[axis 2]]></category>
		<category><![CDATA[bea]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[metro]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsdl]]></category>

		<guid isPermaLink="false">http://brunopereira.org/?p=262</guid>
		<description><![CDATA[Com a minha mudança de alocação da Globo.com para a Globosat, continuo trabalhando bastante com integração de aplicações, mas agora com um ferramental e paradigmas diferentes.
Na Globo.com eu trabalhei muito com open source, e estava acostumado a montar as aplicações a partir de componentes &#8220;crus&#8221;, em vez de usar ferramentas sofisticadas. Open source faz parte [...]]]></description>
			<content:encoded><![CDATA[<p>Com a minha <a href="http://brunopereira.org/2008/11/28/adeus-globocom-foi-um-grande-prazer/" target="_blank">mudança de alocação</a> da <a href="http://www.globo.com" target="_blank">Globo.com</a> para a <a href="http://globosat.globo.com/" target="_blank">Globosat</a>, continuo trabalhando bastante com integração de aplicações, mas agora com um ferramental e paradigmas diferentes.</p>
<p>Na Globo.com eu trabalhei muito com open source, e estava acostumado a montar as aplicações a partir de componentes &#8220;crus&#8221;, em vez de usar ferramentas sofisticadas. Open source faz parte da cultura da empresa, e tínhamos uma boa liberdade de escolha de tecnologias e arquiteturas.</p>
<p>Como falei algumas vezes no passado, nós migramos boa parte da arquitetura legada com EJBs para serviços <a href="http://brunopereira.org/tag/rest/" target="_blank">REST</a> usando por baixo o <a href="https://jersey.dev.java.net/" target="_blank">Jersey</a>, <a href="http://www.springframework.org/" target="_blank">Spring</a> e <a href="http://ibatis.apache.org/" target="_blank">Ibatis</a>. A produtividade no desenvolvimento de serviços REST me agrada muito, e mesmo alguém que não conheça muito de serviços REST consegue desenvolver um serviço sem tanto esforço.</p>
<p>Agora vou trabalhar mais com serviços SOAP, mas usando ferramentas muito produtivas, como o <a href="http://www.bea.com/framework.jsp?CNT=index.htm&amp;FP=/content/products/aqualogic/service_bus/" target="_blank">Aqualogic ESB</a> e o <a href="http://www.bea.com/framework.jsp?CNT=index.htm&amp;FP=/content/products/weblogic/workshop/" target="_blank">Workshop</a>, entre outros. Essas ferramentas facilitam muito o trabalho oferecendo <a href="http://brunopereira.org/2008/12/04/abstracoes-transparentes-e-abstracoes-opacas/" target="_blank">Abstrações Opacas</a>. Como ainda estou muito ligado ao trabalho com Open Source, eu venho tentando no meu tempo vago encontrar ferramentas open source com a mesma proposta.</p>
<p>Neste momento estou tentando encontrar a maneira mais produtiva de se trabalhar com web services SOAP usando open source. No passado eu desenvolvi serviços com o <a href="http://xfire.codehaus.org/" target="_blank">XFire</a>, com o <a href="http://ws.apache.org/axis2/" target="_blank">Axis 2</a> e com o <a href="https://jax-ws.dev.java.net/" target="_blank">JAX-WS</a>, mas achei interessante reavaliar as opções existentes atualmente.</p>
<p>Nos últimos dias eu fiz testes com o Axis 2, com o <a href="http://cxf.apache.org/" target="_blank">Apache CXF</a> e com o JAX-WS.</p>
<p>Eu não gosto muito do Axis 2. Você até consegue desenvolver serviços rapidamente com ele, mas ele gera um código tão sujo que é muito triste colocar qualquer coisa em produção com ele, sabendo que você vai ter que manter depois aquele código. Além disso, para utilizá-lo você precisa levar nada menos que 51 jars para sua aplicação, o que transforma qualquer aplicação em um mastodonte. Um outro problema dessa lista massiva de dependências é que a chance de uma aplicação pré-existente ter conflitos de dependências com o Axis é grande.</p>
<p>Na prática, eu só utilizaria o Axis 2 (e mesmo assim com má vontade) para desenvolver serviços se fosse numa estrutura como o <a href="http://wso2.org/projects/wsas/java" target="_blank">WSO2 Web Services Application Server</a>, que é um servidor de aplicações &#8220;dedicado&#8221; a serviços Axis.</p>
<p>O Apache CXF oferece um &#8220;front-end&#8221; com JAX-WS (que é o mais recomendado) e um &#8220;front-end&#8221; alternativo, que usa o Aegis Databinding. Por enquanto olhei apenas o front-end com JAX-WS, mas não vi nenhuma vantagem em utilizar o CXF em vez da implementação de referência presente no <a href="https://glassfish.dev.java.net/" target="_blank">Glassfish</a>. Se pintar disposição eu darei uma olhada no front-end com Aegis Databinding, mas por enquanto não tenho grandes expectativas em relação a ele não.</p>
<p>Para finalizar, fiz muitos experimentos com a implementação de referência do JAX-WS, embutido no Glassfish V2. A forma de trabalho que achei mais produtiva nestes meus testes foi desenvolvendo com JAX-WS no <a href="http://www.netbeans.org" target="_blank">Netbeans</a> (utilizei a versão 6.5).</p>
<p>Tentei desenvolver a partir de classes Java, e a partir do <a href="http://www.w3.org/TR/wsdl" target="_blank">WSDL</a>, e esta última me trouxe melhores resultados.A melhor forma que achei foi começar desenhando os schemas XML com o editor do Netbeans:</p>
<p><a href="http://brunopereira.org/wp-content/uploads/2008/12/xml_schema_editor.jpg"><img class="alignnone size-full wp-image-263" title="xml_schema_editor" src="http://brunopereira.org/wp-content/uploads/2008/12/xml_schema_editor.jpg" alt="" width="471" height="586" /></a></p>
<p>Criei um Complex Type para cada classe de domínio, e 1 Complex Type para o Request de cada operação e 1 Complex Type para o Response de cada operação. Tendo feito isso, criei depois 1 Element para o Request de cada operação e 1 Element para o Response de cada operação. Com o schema XML criado dessa forma, criei em seguida o WSDL, com o editor do Netbeans também:</p>
<p><a href="http://brunopereira.org/wp-content/uploads/2008/12/wsdl_editor.jpg"><img class="alignnone size-full wp-image-264" title="wsdl_editor" src="http://brunopereira.org/wp-content/uploads/2008/12/wsdl_editor.jpg" alt="" width="418" height="702" /></a></p>
<p>Na criação do WSDL, coloquei nas mensagens de Request/Response das operações os <strong><em>Elementos</em></strong> declarados no schema XML anterior. É importante prestar atenção nisso. Usando Elementos nas mensagens, você está criando serviços no modelo <em><strong>Document/Literal</strong></em>. Se você colocar nas mensagens um <em><strong>Complex Type</strong></em> diretamente, em vez de colocar um <em><strong>Elemento</strong></em>, você estará criando um serviço no modelo <strong><em>RPC/Literal</em></strong>. Eu particularmente prefiro Document/Literal, e o código gerado pelo JAX-WS neste modelo me agrada mais.</p>
<p>A implementação do serviço com JAX-WS ficou parecida com isso aqui:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.brunopereira.cadastro</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.jws.WebService</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.brunopereira.schema.cadastroclientes.CadastroClienteRequestType</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.brunopereira.schema.cadastroclientes.CadastroClienteResponseType</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.brunopereira.schema.cadastroclientes.Cliente</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.brunopereira.wsdl.cadastrocliente.CadastroClientePortType</span><span style="color: #339933;">;</span>
&nbsp;
@WebService<span style="color: #009900;">&#40;</span>serviceName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;CadastroClienteService&quot;</span>, portName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;CadastroClientePort&quot;</span>,
endpointInterface <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;org.brunopereira.wsdl.cadastrocliente.CadastroClientePortType&quot;</span>,
targetNamespace <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://brunopereira.org/wsdl/CadastroCliente&quot;</span>,
wsdlLocation <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;WEB-INF/wsdl/CadastroCliente/CadastroCliente.wsdl&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CadastroCliente <span style="color: #000000; font-weight: bold;">implements</span> CadastroClientePortType <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">public</span> CadastroClienteResponseType cadastrarCliente<span style="color: #009900;">&#40;</span>CadastroClienteRequestType request<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cadastro de cliente foi invocado!! Será feito o roteamento para o serviço adequado!!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
Cliente cliente <span style="color: #339933;">=</span> request.<span style="color: #006633;">getCliente</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
CadastroClienteResponseType response <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CadastroClienteResponseType<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
response.<span style="color: #006633;">setCliente</span><span style="color: #009900;">&#40;</span>cliente<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">return</span> response<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>O código do cliente foi gerado bem facilmente a partir do WSDL também, e ficou bem limpo. O que achei bem fraco foi a parte de teste dos serviços tanto no Netbeans como no Eclipse. No Eclipse você só consegue usar os plugins de teste se você tiver desenvolvido os serviços dentro do Eclipse, o que inviabilizou o meu uso. E o Netbeans tem um suporte que só serve pra HelloWorld, pra aqueles serviços de Calculadora, que você passa uns parâmetros primitivos e recebe um resultado simples. A interface do testador do meu serviço ficou dessa forma:<br />
<a href="http://brunopereira.org/wp-content/uploads/2008/12/web_services_tester.jpg"><img class="alignnone size-full wp-image-265" title="web_services_tester" src="http://brunopereira.org/wp-content/uploads/2008/12/web_services_tester.jpg" alt="" width="800" height="500" /></a></p>
<p>Dá pra ver que não serve para nada além de um HelloWorld basicão.</p>
<p>Bom, de uma maneira geral, o suporte a Web Services no Netbeans é muito melhor do que no Eclipse, que pra piorar só suporta a criação de serviços com o Axis. Até agora a maneira mais produtiva que encontrei de trabalhar com serviços SOAP foi essa que descrevi. Nos próximos dias olharei o que tem de interessante no projeto Metro e no JBoss ESB. Se encontrar coisas interessantes falarei mais por aqui. Ah, e se alguém tiver dicas para melhorar esta forma de trabalho que descrevi, por favor me avisem, pois estou avaliando muita coisa e não dá tempo de dedicar tanto tempo a cada opção dessas.</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2008/12/08/a-procura-de-uma-maneira-produtiva-de-trabalhar-com-web-services-soap/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Interview with Eelco Hillenious and Martijn Dashorst, from Apache Wicket</title>
		<link>http://brunopereira.org/2008/07/06/interview-with-eelco-hillenious-and-martijn-dashorst-from-apache-wicket/</link>
		<comments>http://brunopereira.org/2008/07/06/interview-with-eelco-hillenious-and-martijn-dashorst-from-apache-wicket/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 02:53:23 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[codehaus]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[sourceforge]]></category>
		<category><![CDATA[wicket]]></category>
		<category><![CDATA[wicket in action]]></category>

		<guid isPermaLink="false">http://brunopereira.org/?p=187</guid>
		<description><![CDATA[I really enjoyed the first interview I did some time ago with Robert Elves, from Mylyn. I find very nice to gather some opinions and thoughts from relevant people in our field, and specially people involved with Open Source Software.
This time I was lucky enough to make an interview with Eelco Hillenious and Martijn Dashorst, [...]]]></description>
			<content:encoded><![CDATA[<p>I really enjoyed the <a href="http://brunopereira.org/2008/01/07/interview-with-robert-elves-from-mylyn-project/" target="_self">first interview I did some time ago</a> with Robert Elves, from <a href="http://www.eclipse.org/mylyn" target="_blank">Mylyn</a>. I find very nice to gather some opinions and thoughts from relevant people in our field, and specially people involved with Open Source Software.</p>
<p>This time I was lucky enough to make an interview with <a href="http://chillenious.wordpress.com/" target="_blank">Eelco Hillenious</a> and <a href="http://martijndashorst.com/blog" target="_blank">Martijn Dashorst</a>, from <a href="http://wicket.apache.org" target="_blank">Apache Wicket</a>. I&#8217;m pretty happy with the results, and I hope you guys enjoy it too. On to the interview!</p>
<p><strong>Bruno Pereira: <em>How did you first get involved with Wicket?</em></strong></p>
<p><strong>Eelco Hillenious:</strong> At Topicus where I worked a few years ago, we had been looking for good web framework for a while to help us address the issues we had with scaling our developing effort. We were doing a couple of reasonably large projects using web MVC frameworks Struts and Maverick. The user interfaces were quite complex at times &#8211; they had things like nested tabs, wizards and paginated lists &#8211; and we had a hard time implementing them with those frameworks in a maintainable fashion. Also, we were bummed by the fact that we couldn&#8217;t reuse parts of what we did elsewhere in a project &#8211; search/ result panels for instance &#8211; and that we ended up with so much copy paste code and ad-hoc session usage. And for one of the projects, we were developing customer-specific variants. Again, we ran into the problem that it wasn&#8217;t easy to reuse elements of the user interface that we had developed elsewhere.</p>
<p>Another reason we were looking for alternatives for web development with Java is that we saw that colleagues who were using ASP.NET were faster and produced better maintainable code than we were with Java. They even had more fun doing it; pretty much everyone on the Java team hated to do the web work.</p>
<p>I started out evaluating JSF, which was by then nearing completion. In my experience however, one of the major problems with the way we were developing web applications was the fact that so much logic was put in templates. Not only does that make refactoring harder, it also means that you get thrown back to a procedural programming model where you can&#8217;t reap the benefits like static typing and encapsulation, etc. So I wasn&#8217;t to crazy about the role JSPs play(ed) in JSF. I did give JSF a serious look though. I read a book on it, walked through the source code and created a simple proof of concept. But the further I got with it, the more I hated it, up to the point that I simply didn&#8217;t want to put any of my spare time with it. I just didn&#8217;t like much of the architecture, and man, creating custom JSF components was even more work than creating custom JSP tags (which isn&#8217;t exactly the most elegant thing to code either).</p>
<p>After that I looked at Echo. I liked Echo. I still do in fact, even though I never actually worked with it. However, I didn&#8217;t think it would be a good choice for what we were doing, because it works with layout managers. As much as I like Swing coding, I actually prefer working with HTML/ CSS to Swing&#8217;s layout managers. Furthermore, I had this hope that one day we wouldn&#8217;t be translating Photoshop designs into screens ourselves, but rather have a designer creating mockups for us that we could use with minimal adjustments.</p>
<p>I also gave Tapestry (3) a serious look. I started reading Tapestry In Action, looked at the source code (which imho looked a lot better than JSF&#8217;s), and started experimenting. Halfway through the book, I had a big stack of &#8216;why?!&#8217;s. I could agree with the thoughts behind the concepts, but I didn&#8217;t agree with some of the solutions. Abstract classes, rewinding; it just had this stench of premature optimization to me. Still, I was ready to introduce Tapestry at Topicus, as I thought that it at least looked like an improvement for us. When I started talking to colleagues about this however, it turned out that some people had actually used it before and were quite unhappy with it. I would clearly make a couple of people unhappy by going through with it, so I didn&#8217;t.</p>
<p>A couple of months later &#8211; I kind of had given up for the moment &#8211; colleague Johan stormed into the office saying he found the framework we&#8217;ve been looking for: &#8220;Wicket&#8221;. It was (and is) centered around &#8216;Just Java&#8217; programming, with clean templates and reusable components. I remember we checked it out, had a simple example running in under an hour and were pretty much sold to the framework that same afternoon. Wicket was very rough, incomplete even, back then, but it had the core ideas right. It was still alpha code, but the code base looked very well engineered, and Wicket already worked well for the things we tested.</p>
<p>So we started building a prototype with Wicket. We had a fun few weeks, and we already agreed that this should be the framework that would give Topicus their competitive edge in the near future. We also felt we weren&#8217;t ready to be transformed to be ASP.NET coders just yet. But then Jonathan Locke &#8211; the inventor of Wicket &#8211; sent a message to the list that he was about to shut down the project because he accepted a job at Microsoft and it would be a conflict of interest for him to keep working on Wicket. That would have such a waste to let that happen! So I got Johan and Martijn in a room, and asked them if they wanted to help out and take Wicket over. We agreed to commit to at least a year of whatever it would take of our spare time to turn<br />
Wicket into a mature project suitable for Topicus, and hopefully with a viable community around it as well. We also invited Juergen and Chris to join us. They were already active on the list and had sent in a few good patches. The cooperation turned out great, and when Jonathan left Microsoft again a few months later (for unrelated reasons), we welcomed him back into a Wicket that was quickly approaching a 1.0 release and had a good core of early adopters.</p>
<p><strong>Martijn Dashorst:</strong> Mostly like Eelco&#8217;s answer, but from a different perspective: I was a Windows client developer used to build GUI&#8217;s with Borland&#8217;s VCL. Then I had to build web apps using Maverick and Velocity. I hated that experience and constantly asked myself: WHY is this so hard and so much work. Wicket salvaged me from this negative experience: it felt like returning to VCL programming and for the first time I enjoyed<br />
building web apps.</p>
<p><strong>BP:</strong> <strong><em>We have perhaps a hundred Java web frameworks, and Wicket was not among the first of them. However, I like to put Wicket in a separate class from the others, as it offers a new paradigm of web application development. How would you say Wicket fits in this field and what does it bring to Java web developers?</em></strong></p>
<p><strong>EH:</strong> Many of these alternatives are really flavors of the same model 2 ideas. In my opinion, there are basically these frameworks &#8211; Struts, WebWork, SpringMVC, whatever-the-flavor-of-the-day &#8211; and frameworks like Wicket but also GWT, Echo and Tapestry that really provide a different alternative.</p>
<p>Most web frameworks go through great lengths trying keep their users far away from regular Java programming. Wicket provides a programming model that stays as close to Java as it can, with all the advantages of static typing, encapsulation, etc.</p>
<p><strong>BP:</strong> <strong><em>JSF is perhaps Wicket&#8217;s strongest competitor (if there is such a thing), and it benefits from Sun&#8217;s support, good development tools and a huge set of avaiable components. How is Wicket evolving in terms of tooling support and avaiable components?</em></strong></p>
<p><strong>EH:</strong> Frankly, I think JSF isn&#8217;t doing so great when it comes to the availability of components. Much like the component market for ASP.NET, there is a lot of promise but not much delivery if you ask me. Yes, there are a bunch of component libraries out there, but they are often incompatible and are often quite monolithic. The latter is JSF&#8217;s fault really.</p>
<p>The fact that Wicket tries to make creating custom components as easy as possible (ideally, as easy as extending a class and maybe providing some markup that goes with it), makes that it is less relevant what<br />
components are out there. You want to have a good base set of components that are easy to extend and/ or customize, and hopefully people will create their own library of components that suit their particular needs.</p>
<p>That said, Wicket actually has an impressive range of custom components. Besides the decent number of components that are available as part of the core Wicket projects, there are a ton of projects in wicket-stuff (of varying quality, but there are a few real gems in there), and there are initiatives like DataBinder and InMethod that provide custom components.</p>
<p>But really the best way to go with Wicket in my opinion is to create a layer of base components for your project that look and behave exactly what you need. A little bit of work upfront, but it can save you a lot of work and maybe even code duplication later on.</p>
<p>FWIW, I don&#8217;t view JSF as our largest competitor in Java land; I would think that is GWT. There&#8217;s pros and cons to both GWT and Wicket, and I certainly think Wicket has an edge in some areas, but GWT is very cool conceptually, and from what I&#8217;ve seen it is very nicely done and even has tooling support that actually works.</p>
<p><strong>BP:</strong> <strong><em>We have seen many Ruby on Rails zealots claiming Java&#8217;s dead and that RoR is the next big thing. I&#8217;d like to know your thoughts on that. Can we consider ourselves Java&#8217;s orphans? <img src='http://brunopereira.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></strong></p>
<p><strong>EH:</strong> Nah. The hype is already sinking in, and you read more about infighting dramas than success stories nowadays. I&#8217;ve also heard several stories from developers who actually did do one or two serious RoR projects, and as much as they liked having quick results the first few weeks, they got into a mess later on. Basically, their code base grew, they got more people on the project, all with their own ideas of neat DSL-like constructs and gung-ho LOC saving tricks, and pretty soon no-one understood much of what was going in that code on any more. And some of those people actually did have real scaling problems.</p>
<p>Much of the critique on Java from the RoR camp (and others) was quite justified however, and I think J(2)EE can take much of the blame for that. You can develop quite &#8216;light&#8217; and practical with Java if you just ignore most of the heavy sounding advice you see on &#8216;enterprise development&#8217; and use your own brain instead. Unfortunately, the idea that the next step in productivity is dumbing down development by providing more wizards, drag and drop tools and servers that clean your house and do your shopping on the side is wide spread. To me, the most exiting thing about the whole RoR uproar was that it brought back the spot light on coding instead of big fancy tooling and servers.</p>
<p><strong>BP:</strong><em> <strong>I know several Wicket developers like Scala, which seems to be a very promising new language. Do you think it will become mainstream in a near future?  Will Wicket have something done in Scala?</strong></em></p>
<p><strong>EH:</strong> That&#8217;s hard to say. I like some of the ideas of Scala. It really looks like an incredible piece of work, and there are plenty of things in Scala that I&#8217;d love to work with today. It would make working with Wicket a lot more elegant, and it definitively would make my own code a lot nicer.</p>
<p>However. What almost everybody I spoken to about Scala says, is that Scala provides too much freedom, too many ways to achieve the same thing. They may be right. Part of me says, well, it would be great to have a language just for the experienced people who hopefully know how to use constructs with taste. But then again, I haven&#8217;t seen much actual Scala code or discussions on the Scala list that give me that warm fuzzy feeling. In fact, when I lurked on their list a while back, quite a number of the discussion were about how to make notations even shorter (and consequently less readable). Research says that the bulk of the cost of producing software comes &#8216;after version 1.0&#8242;, and that&#8217;s my own experience as well. Maintainable, understandable and predictable software is what we need, even if it means that you need to write out a few more lines. Less code is great for maintainability, but it needs to be readable at the very least.</p>
<p>Also, I firmly believe Scala needs a *very* good IDE to succeed. I&#8217;m a fan of good IDEs. I like the time they save me when looking at new code (code navigation, javadoc hoovers, code generation and completion). Without good IDE support for Scala, I&#8217;m simply more productive with Java, even though it means that I have to implement ugly workarounds for things that would have been easy and elegant with Scala. There are some initiatives for IDE support but I think that to get something really good, there has to be industry support. Maybe one of these days a vendor realizes how much of their effort they are wasting on JSF and see the potential in Scala.</p>
<p>Another thing Scala badly needs is a bunch of people who can sell it. The fact that RoR looked sexy from the start might have been quite an important factor in their success, and Scala currently is probably the un-sexiest looking framework on the planet. And that&#8217;s &#8216;just&#8217; a matter of community building really. I&#8217;m sure if people are interested in making Scala a success, they can find people to work on their image and get the name out there.</p>
<p>Anyway, we&#8217;ll see. I hope Scala can be a good counter to .NET on the long term; it could be the Java variant of F#, and maybe we&#8217;ll get our own taste of LINQ with it.</p>
<p><strong>BP:</strong> <strong><em>Wicket started as a project on Sourceforge, then it was incubated in Apache Software Foundation, and finally became an Apache top level project. I&#8217;d like you to comment on this process of joining the most respected open source foundation. How was this experience?</em></strong></p>
<p><strong>EH:</strong> It actually started as a project on codehaus. Unfortunately, we had problems getting commit rights after we wanted to take over from Jonathan, and after waiting for a few weeks, we decided to move the project to Sourceforge.</p>
<p>The experience was good. We had a couple of mentors who were great in guiding us through and backing us up with discussions.</p>
<p>What we got from moving to Apache is &#8211; amongst other things like image and stuff &#8211; that we are even more conscious about our community. I think we always had the proper open source attitude, which means so<br />
much that you try to get people to participate, take them seriously in discussions, and understand that it comes with a responsibility, but now we don&#8217;t have just our name to keep high, but also Apache&#8217;s name.<br />
Oh, and it was very nice to attend conferences and put some faces on the names of the people who have been slaving on their own cool projects.</p>
<p><strong>MD</strong>: Joining took longer than we expected, but Apache folks constantly remind me that Wicket was actually one of the fastest projects to go through the incubator. The slowness was really our own fault: we didn&#8217;t concentrate on getting out but were too caught up in maintaining three branches. When we axed one main development branch we were able to get out of the incubator in a couple of weeks.</p>
<p>Apache brings us a solid legal foundation to our code. Although this adds more ceremony to releasing and accepting new code made by third parties. I think it is worth the extra effort to have a solid legal foundation at the base of our code.</p>
<p>Another thing that Apache brings and one probably can only understand by experiencing it first hand is that Apache is a Community of projects &#8211; not a couple of projects sharing a server. There is a large difference between Apache and sourceforge, googlecode, java.net. The latter three are just servers with a lot of projects on them.</p>
<p><strong>BP:</strong> <strong><em>Wicket has a distributed development team, much like most open source projects. I&#8217;d like you to describe your development process, and how do you manage the community contributions.</em></strong></p>
<p><strong>EH:</strong> You can find all that on the Apache site! <img src='http://brunopereira.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I would say every thing goes very bottom up. Everyone feels responsible to take up things, and activity of most people fluctuates. We have a large, very active community and there is lots of discussion, bug reports and patch submissions (though we can never have enough of those!) happening. We all have our own areas of the code base we like to work on, but in principal, anyone can work on anything. We don&#8217;t always do a lot of upfront discussing regarding fixes etc (unless of course, something isn&#8217;t clear to start with), but we all keep an eye on the commit logs, and you can regularly see a discussion start about a commit, sometimes resulting in rolling back or further tweaking the code. We&#8217;ve worked like that from the start, and I still think it works great.</p>
<p><strong>BP:</strong> <strong><em>You guys are finishing the writing of Wicket in Action, the second book on Wicket. I read the first seven chapters, and the book helped me a lot understanding some aspects of the framework. I&#8217;d like you to talk about the book experience, and how do you expect it to help Wicket&#8217;s adoption.</em></strong></p>
<p><strong>EH:</strong> The third book by now even! Kent Tong also wrote a book on Wicket.</p>
<p>I hope the publisher isn&#8217;t reading this, but I hate(d) writing the book. Martijn and I did it primarily for Wicket and it&#8217;s community, so that people would have some more ammo convincing their managers to adopt Wicket, and to give Wicket&#8217;s users a better understanding of how Wicket can be used successfully. Neither of us wrote a book before, and we figured, oh what the heck, it&#8217;s something to brag about in front of the grand kids when we&#8217;re 70. Well, we certainly hope the bragging will be good, and many people will benefit from reading it, because it was a lousy experience for us. It brought me back to high school, when I pretty much never did any of my home work (in fact, I would often skip school to work on my C64 programs), but still had enough of a conscience to feel guilty about it. Writing Wicket In Action was like that. I would put things off &#8211; hiking, making music, checking out bands &#8211; because I felt I had to reserve my evenings and weekends for writing. And often, in the end, I didn&#8217;t even get to do much because I was uninspired, or a friend showed up, or we had to do shopping or cleaning the house. And then I&#8217;d feel guilty again!</p>
<p>I would sum it up by saying that for me it felt like work, whereas coding on Wicket in my spare time felt like a hobby. If I would do it all over again, I would take a few months off and write during the days. That would probably make the whole thing acceptable (though coding is still much more fun).</p>
<p><strong>MD:</strong> One remark: don&#8217;t write a book in your spare time. Eelco and I have been writing this book for over 2 years now. This means: no hobbies for 2 years. Bringing laptops with you on vacations to write. Staying<br />
up until 2am writing and getting up at 7am because the day job also needs your attention. And all this for more than 2 years.</p>
<p>If I would have to do it again (which I doubt, my wife would kill me), I would do it full time instead of in the little hours after work.</p>
<p>The book itself is coming together quite nice. We have quite a lot of folks that help us with the book: our early access readers (THANK YOU!) and we have an excellent editorial team. Since Wicket has such a large surface area, I even use the book to learn more or look up things. So you can say it caters to both beginners and more experienced Wicket users.</p>
<p><strong>BP:</strong> <strong><em>Wicket recently released the 1.3 version, the first after becoming an Apache project. Could you provide us a vision of the current state and the future of the project?</em></strong></p>
<p><strong>EH:</strong> We are regularly discussing this on the list, and we&#8217;re currently working on Wicket 1.4.</p>
<p>1.3 is a solid release. 1.2 can be used in production environments just fine, but 1.3 is optimized in many ways, and we got most of our API streamlined in a fashion that should last for a few years now.</p>
<p>1.4 has a limited scope in that it only introduces generics and Wicket with a couple of other Java 5 features people have been wanting for a long time. 1.4 should be backwards compatible. You&#8217;ll just see plenty of warnings when you don&#8217;t use generics. So Wicket In Action should be good for 1.4 without adoption.</p>
<p>What we&#8217;ll do after that is open to debate. We definitively got the message from all the ex-Tapestry users that we should not go overboard with API changes between releases, so we&#8217;ll do our best to keep providing smooth upgrade paths between releases.</p>
<p>One thing we&#8217;ll probably look at is how to make controlling what URLs are generated even better. This is very flexible already, but a bit clunky at times.</p>
<p>Closures could make Wicket a lot nicer to work with as well. Though, considering that we just now switched to Java 5, that might take a while to get into the framework.</p>
<p>And who knows&#8230; if Scala gets good IDE support and a good sized following, I think it would be exiting to see what we could do with it in for Wicket. I think we could build on top of the Java version, and provide a thin framework that makes working with Wicket in Scala smooth.</p>
<p><strong>MD:</strong> The future will bring beautiful things. I expect us to work on better integration with JavaScript libraries and trying to implement the Yahoo rules for performance (merging javascript files into one to limit the number of http requests, etc). Versioning of JavaScript libraries is also something I like to see solved in the future. We are also going to take a good look at our unit testing framework: it is pretty solid but the API doesn&#8217;t feel Wicket like. I&#8217;d also like to integrate an animation framework into our Ajax implementation to<br />
enable effects when updating pages. I think that it currently is harder to do than strictly necessary.</p>
<p><strong>BP:</strong> <strong><em>Closing thoughts&#8230;</em></strong></p>
<p><strong>EH:</strong> Thanks for the interview! And download the first chapter of Wicket In Action for free at: http://www.manning.com/dashorst/; even if Wicket isn&#8217;t your thing, I hope it gives readers some background in the problems it tries to solve.</p>
<p><strong>MD:</strong> I know that a couple of Brazilian companies have adopted Wicket for their main development. I&#8217;d like to see a Brazilian community evolve and generate such events as we have in Europe (Amsterdam, London, Copenhagen) because I&#8217;d love to visit your country again <img src='http://brunopereira.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . If you are not a Wicket user, then check out our examples: http://wicketstuff.org/wicket13 or http://wicketstuff.org/wicket14 (may not be available now, but will in the future). Our community is very welcoming and active: join our user list to ask questions and<br />
help out. Join the dev list to help us make a framework you want to use. And if you don&#8217;t fancy email, you can join our irc channel that is always available: ##wicket at irc.freenode.net. Obrigado!</p>
<p>Well, if you read til this point, I hope you&#8217;ve enjoyed! Please leave your comments if you wish.</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2008/07/06/interview-with-eelco-hillenious-and-martijn-dashorst-from-apache-wicket/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>mod_rewrite</title>
		<link>http://brunopereira.org/2008/03/11/mod_rewrite/</link>
		<comments>http://brunopereira.org/2008/03/11/mod_rewrite/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 01:09:19 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache software foundation]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://blpsilva.wordpress.com/?p=106</guid>
		<description><![CDATA[Hoje assisti a um Tech Talk bem interessante na Globo, sobre mod_rewrite. Além de funcionalidades interessantes deste módulo do Apache, as discussões na apresentação me trouxeram vários questionamentos de como incluir de forma mais ativa o Apache em uma arquitetura RESTFul.
Eu já utilizei bastante o Apache na remota época em que eu desenvolvia algumas coisas [...]]]></description>
			<content:encoded><![CDATA[<p>Hoje assisti a um Tech Talk bem interessante na Globo, sobre mod_rewrite. Além de funcionalidades interessantes deste módulo do Apache, as discussões na apresentação me trouxeram vários questionamentos de como incluir de forma mais ativa o Apache em uma arquitetura RESTFul.</p>
<p>Eu já utilizei bastante o Apache na remota época em que eu desenvolvia algumas coisas em Php. Na verdade não fazia nada de muito sofisticado, mas tinha boa familiaridade com os módulos, com a configuração, essas coisas. Depois que foquei mais no uso de servidores de aplicação Java, deixei o Apache em segundo plano. Praticamente só vinha usando o Apache para servir conteúdo estático, e claro, nele também ficam configurados os conectores para comunicação com os servidores de aplicação.</p>
<p>Como tenho trabalhado bastante com web services REST, venho tentando explorar ao máximo os recursos do HTTP para elaborar protocolos de comunicação concisos e intuitivos. Neste sentido, o Apache oferece recursos muito interessantes. Por exemplo, quando utilizamos URIs no formato /usuario/123456/item/25 para representar um determinado item de um determinado usuário, a resposta a esta requisição é cacheável pelo Apache. Entretanto, ao utilizar URIs neste formato você precisa definir uma forma de fazer o parsing da URI para pegar os parâmetros relevantes.</p>
<p>No meu artigo de REST da Java Magazine de Abril eu usei o StringTokenizer do JDK para fazer a quebra da URI e pegar os valores que me interessavam. A JSR-311 define uma forma bem interessante de fazer isso com annotations também. E hoje fui descobrir que o mod_rewrite também pode fazer facilmente a quebra de URIs neste formato em URIs com parâmetros em query string por exemplo.</p>
<p>Uma utilização inteligente do cache do servidor web e de módulos de proxy também pode tornar a arquitetura da aplicação bem eficiente e reduzir bastante a carga sobre os servidores de aplicação. Se eu posso utilizar diretamente o cache do Apache para várias URIs, não vale a pena deixar as requisições chegarem ao container de servlets, mesmo que ele responda também com dados em cache.</p>
<p>Vendo o poder e a facilidade de uso de alguns módulos do Apache, me sinto obrigado a ter total familiaridade com ele novamente. Aos poucos irei estudando e integrando os módulos do Apache à arquitetura das minhas aplicações REST, pois isto pode trazer um belo ganho de performance e escalabilidade. Afinal de contas, quem quer explorar a fundo os recursos do HTTP não pode abrir mão de explorar a fundo um servidor tão confiável e maduro como o Apache, não é mesmo?</p>
<p>OBS: uns anos atrás eu dizia pra mim mesmo que o dia que eu conhecesse pelo menos vagamente metade dos projetos na home da Apache Software Foundation eu já teria uma boa bagagem. Hoje em dia já conheço mais da metade do projetos da home, e admiro cada vez mais esta fundação. O mundo open source não chegaria aos pés do que é hoje sem a existência da ASF. Um belo exemplo de qualidade em software!</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2008/03/11/mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diversidade de tecnologias</title>
		<link>http://brunopereira.org/2008/02/11/diversidade-de-tecnologias/</link>
		<comments>http://brunopereira.org/2008/02/11/diversidade-de-tecnologias/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 00:00:54 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache abdera]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[atompub]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://blpsilva.wordpress.com/?p=83</guid>
		<description><![CDATA[Eu tenho postado com alguma freqüência sobre o que vem acontecendo no desenvolvimento das tecnologias dos web services Restful.
Este fim de semana o James Snell implementou um adapter do Apache Abdera para o CouchDB. Este adapter permite que se consiga facilmente implementar um armazenamento de dados no formato Atom com uso de uma instância do [...]]]></description>
			<content:encoded><![CDATA[<p>Eu tenho postado com alguma freqüência sobre o que vem acontecendo no desenvolvimento das tecnologias dos web services Restful.</p>
<p>Este fim de semana o <a href="http://www.snellspace.com/wp/?p=880" target="_blank">James Snell</a> implementou um adapter do <a href="http://incubator.apache.org/abdera/" target="_blank">Apache Abdera</a> para o <a href="http://en.wikipedia.org/wiki/CouchDB" target="_blank">CouchDB</a>. Este adapter permite que se consiga facilmente implementar um armazenamento de dados no formato Atom com uso de uma instância do CouchDB.</p>
<p>Como eu já mencionei <a href="http://brunopereira.org/2008/02/06/jersey-meets-abdera/" target="_blank">anteriormente</a>, o Abdera oferece uma API para manipulação de conteúdo no formato Atom e a realização de operações do Atom Publishing Protocol. Já o CouchDB é um banco de dados orientado a documentos que é escrito em <a href="http://en.wikipedia.org/wiki/Erlang_(programming_language)" target="_blank">Erlang</a> e foi projetado para extrema escalabilidade e permite fácil instalação em servidores com múltiplos núcleos ou em clusters de máquinas.</p>
<p>Em vez de utilizar tabelas com colunas (como os bancos de dados relacionais), o CouchDB armazena os documentos em formato JSON e disponibiliza como interface uma API Restful, com clientes já implementados em várias linguagens, como Javascript, Java, PHP, Ruby e Python.</p>
<p>Acho que isto expressa muito bem o horizonte que vem se formando. Em vez de pilha de tecnologias e protocolos proprietários, temos diversas tecnologias e plataformas diferentes conseguindo se comunicar através de HTTP. Um projeto open source Java que manipula conteúdo Atom já disponibiliza com facilidade um mecanismo de integração com serviços REST que manipulam dados em formato JSON.</p>
<p>É impressão minha ou estamos de fato vendo rapidamente uma mudança radical de abordagem na vanguarda da tecnologia? A mesma IBM que antigamente dominava de forma absoluta todo o mercado de hardware e software com soluções proprietárias agora patrocina diversos projetos open source e mantém sua elite intelectual trabalhando nestes projetos.</p>
<p>Soluções open source estão liderando várias frentes de desenvolvimento e com isso rapidamente surgem integrações entre componentes feitos em diferentes linguagens e plataformas. O conhecimento não está mais guardado a 7 chaves, e sim discutido abertamente por uma comunidade que aceita qualquer um com capacidade para agregar idéias boas.</p>
<p>A criatividade e a iniciativa individual nunca tiveram tanto poder, e isto é fabuloso. Com isso, claro que a versatilidade e o conhecimento diversificado ficam muito valiosos.</p>
<p>Hum&#8230; maybe it&#8217;s time for me to fight my disgust for Javascript and start developing something nice including JSON <img src='http://brunopereira.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2008/02/11/diversidade-de-tecnologias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@dvogado.com aprovado no java.net!</title>
		<link>http://brunopereira.org/2007/11/28/dvogadocom-aprovado-no-javanet/</link>
		<comments>http://brunopereira.org/2007/11/28/dvogadocom-aprovado-no-javanet/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 20:50:45 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[@dvogado.com]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[software jurídico]]></category>
		<category><![CDATA[software para advogados]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://blpsilva.wordpress.com/2007/11/28/dvogadocom-aprovado-no-javanet/</guid>
		<description><![CDATA[Caros amigos, já comentei aqui anteriormente que no meu tempo vago desenvolvo um software para advogados. Este projeto é open source e está em desenvolvimento, ainda não tendo nenhuma release.Algumas semanas atrás eu cadastrei o projeto no java.net, e hoje recebi o e-mail me informando que ele foi aprovado lá! O projeto está oficialmente incubado [...]]]></description>
			<content:encoded><![CDATA[<p>Caros amigos, já comentei aqui anteriormente que no meu tempo vago desenvolvo um software para advogados. Este projeto é open source e está em desenvolvimento, ainda não tendo nenhuma release.Algumas semanas atrás eu cadastrei o projeto no java.net, e hoje recebi o e-mail me informando que ele foi aprovado lá! O projeto está oficialmente incubado no java.net. A home do projeto lá é <a href="https://advogadocom.dev.java.net/" title="@dvogado.com" target="_blank">https://advogadocom.dev.java.net/</a></p>
<p>Os detalhes do projeto podem ser vistos na página do java.net, mas a arquiteturá básica terá <a href="http://tomcat.apache.org" target="_blank">Apache 	Tomcat</a> 6.0.x + <a href="http://db.apache.org/derby/" title="Derby" target="_blank">Apache Derby</a> 10.x + Java RE 6 + <a href="http://wicket.apache.org" title="Wicket" target="_blank">Apache Wicket</a> como framework web.</p>
<p>Quando tiver mais novidades do projeto, voltarei a postar aqui! <img src='http://brunopereira.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2007/11/28/dvogadocom-aprovado-no-javanet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>REST e AtomPub</title>
		<link>http://brunopereira.org/2007/11/26/rest-e-atompub/</link>
		<comments>http://brunopereira.org/2007/11/26/rest-e-atompub/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 17:32:04 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache abdera]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[atompub]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://blpsilva.wordpress.com/2007/11/26/rest-e-atompub/</guid>
		<description><![CDATA[Este fim de semana estudei mais um pouco de REST e Atom. O Atom Publishing Protocol é um protocolo de publicação de posts e feeds de blogs, que utiliza publicações no formato Atom (uma alternativa mais nova e mais rica do que o RSS)O motivo que me levou a estudar o Atom e o AtomPub [...]]]></description>
			<content:encoded><![CDATA[<p>Este fim de semana estudei mais um pouco de REST e Atom. O Atom Publishing Protocol é um protocolo de publicação de posts e feeds de blogs, que utiliza publicações no formato Atom (uma alternativa mais nova e mais rica do que o RSS)O motivo que me levou a estudar o Atom e o AtomPub é que o AtomPub está começando a ser usado como &#8220;implementação de referência&#8221; de web services REST. Não é que o protocolo do AtomPub em si seja voltado para web services em geral, mas ele é uma implementação muito inteligente e eficiente de web services REST para publicação em blogs, e então as idéias aplicadas para este tipo de aplicação estão começando a ser utilizadas de uma forma mais geral.</p>
<p>Embora não seja a mesma coisa, de certa forma podemos dizer que o AtomPub está para os web services REST assim como um framework como o Struts está para o desenvolvimento web. A comparação não é tão boa porque o AtomPub ainda é mais uma &#8220;inspiração&#8221; de implementação, um exemplo bem-sucedido de web services REST, enquanto o Struts é um framework para desenvolvimento web, no qual muitas aplicações estão baseadas e foram construídas por cima.</p>
<p>O AtomPub chega em ótimo momento, pois os web services REST vêm se firmando como uma ótima opção de implementação em boa parte dos casos, comparando com SOAP. Entretanto, REST é apenas um estilo de arquitetura, que permite uma enorme flexibilidade em termos de implementação. Como as idéias propostas pela arquitetura REST são abstratas em alguns aspectos, analisar como o AtomPub foi implementado é muito interessante e esclarecedor.</p>
<p>Um projeto open source que oferece uma API para criar, editar, ler e remover posts e feeds no formato Atom utilizando o Atom Publishing Protocol é o Apache Abdera. Este projeto ainda está incubado na Apache e ainda não está nem em beta, mas as releases atuais de desenvolvimento já permitem fazer algumas coisas interessantes e o projeto promete crescer, pois o Mule já está o utilizando como componente para implementação de web services REST no ESB deles.</p>
<p>Eu já consegui fazer uns exemplos legais com o Abdera, publicando através da API deles uns posts no blogger do Google e criando eventos no Google Calendar. Ainda estou estudando e conhecendo melhor o AtomPub, e o Abdera, mas tenho certeza de que veremos coisas boas daí, e penso que este é o caminho mais promissor de web services atualmente. Can&#8217;t wait to get to know it even better!</p>
<p>Quando souber de mais coisas interessantes nesse assunto, publicarei aqui!</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2007/11/26/rest-e-atompub/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Make deployments as simple as possible</title>
		<link>http://brunopereira.org/2007/11/21/make-deployments-as-simple-as-possible/</link>
		<comments>http://brunopereira.org/2007/11/21/make-deployments-as-simple-as-possible/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 00:51:23 +0000</pubDate>
		<dc:creator>blpsilva</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[posts em português]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[Sun]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://blpsilva.wordpress.com/2007/11/21/make-deployments-as-simple-as-possible/</guid>
		<description><![CDATA[O título deste post é uma das preciosas dicas presentes no Effective Enterprise Java. Esta dica faz bastante sentido em ambientes corporativos, onde em boa parte dos casos não são os desenvolvedores que farão o deployment da aplicação, e sim uma equipe de operações. Quanto mais fácil for o processo de deployment da sua aplicação, [...]]]></description>
			<content:encoded><![CDATA[<p>O título deste post é uma das preciosas dicas presentes no <a href="http://www.amazon.com/Effective-Enterprise-Java-Software-Development/dp/0321130006/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1195603647&amp;sr=1-1" title="Effective enterprise Java" target="_blank">Effective Enterprise Java</a>. Esta dica faz bastante sentido em ambientes corporativos, onde em boa parte dos casos não são os desenvolvedores que farão o deployment da aplicação, e sim uma equipe de operações. Quanto mais fácil for o processo de deployment da sua aplicação, mais chances de que a equipe de operações faça o deployment corretamente, e menos chances de eles terem problemas que você precise ajudar.Bom, quanto à validade desta dica em ambientes corporativos eu já estava ciente faz tempo, e sempre me guio por ela quando preciso montar a forma de distribuição de uma aplicação. Entretanto, há alguns meses eu fui vivenciar a validade desta dica também em ambientes não corporativos, com uma pessoa leiga tentando usar um software distribuído individualmente.</p>
<p>Eu estou desenvolvendo no meu tempo vago um software para advogados. O principal intuito deste software é permitir a gerência de processos, clientes, audiências, reuniões, etc. A idéia é que o software possa ser utilizado individualmente por um advogado ou de forma compartilhada em um escritório por exemplo. A aplicação é Java e possui interface web. Qualquer pessoa com acesso à máquina onde a aplicação estiver rodando pode utilizar a mesma.</p>
<p>A idéia de instalar um servidor de aplicações e um servidor de banco de dados em um escritório não é tão amedrontadora, embora de certa forma dificulte a distribuição em massa da aplicação. Porém, imaginem que para utilizar a aplicação individualmente em uma máquina em casa um advogado precise instalar o Java e um servidor de aplicações, instalar um servidor de banco de dados, copiar a aplicação para o servidor de aplicações e então usar o software. That&#8217;s not gonna happen, forget it!!</p>
<p>Qual seria uma solução mais fácil? Criar um instalador que faça estas instalações todas, crie atalhos, etc? Acho que isso resolveria sim. Mas eu não tenho muita experiência em criar instaladores, e eu também quero permitir que a aplicação seja utilizada no Linux e no Mac OS além do Windows. Prefiro uma solução ainda mais fácil que a de um instalador.</p>
<p>Todo mundo hoje em dia possui algum software de compactação (zip, rar, etc)  em casa, e acredito que qualquer pessoa que se proponha a utilizar um software para advogados saiba descompactar arquivos. E se fosse possível fornecer um único arquivo zipado para o usuário e este precisasse apenas descompactar o arquivo para qualquer diretório de sua preferência e clicar em um atalho para utilizar o software? Isto é ainda mais fácil que um instalador, não é?</p>
<p>O <a href="http://www.atlassian.com/software/jira/" title="JIRA">Jira</a> Standalone é distribuído como um zip que você precisa apenas descompactar e usar, contanto que a sua máquina possua Java instalado (e que o Jira encontre seu Java). Eu gostei bastante desta forma de distribuição, ela é muuuuito mais prática do que a instalação do Trac ou do Bugzilla por exemplo.</p>
<p>Entretanto, eu não quero exigir que um advogado tenha instalado previamente o Java e muito menos que ele configure qualquer variável de ambiente para utilizar meu software. Então resolvi facilitar a vida deles. A minha aplicação web utilizará o Tomcat, Wicket e o Derby como banco de dados, e eu vou distribuir tudo isso empacotado junto com JRE em um único zip para que o usuário descompacte e use.</p>
<p>Fazendo isto eu consigo garantir que todos os requisitos da aplicação estarão presentes e bem configurados, e de lambuja saberei sempre que as versões de todos os componentes são compatíveis, porque eu distribuirei versões previamente validadas de todos eles. Quando eu quiser atualizar a versão de tudo, sem problemas também.</p>
<p>A propósito, já li as licenças de cada um dos componentes e eu posso livremente distribuí-los ao usuário final sem custos, contanto que eu distribua o JRE da forma que obtive da Sun.</p>
<p>Open source is powerful and beautiful, isn&#8217;t it? E aí, o que acham desta forma de distribuição? Críticas são bem-vindas!</p>
]]></content:encoded>
			<wfw:commentRss>http://brunopereira.org/2007/11/21/make-deployments-as-simple-as-possible/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

