<?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>SemtexGirl</title>
	<atom:link href="http://www.semtexgirl.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.semtexgirl.net</link>
	<description>É uma garota dinâmica e de bom gosto, uma garota que explode, que não para e nem aceita um não como resposta.</description>
	<lastBuildDate>Fri, 25 Mar 2011 19:37:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Manhê! Tô na Globo!!! Galvão filma eu!</title>
		<link>http://www.semtexgirl.net/2011/03/25/manhe-to-na-globo-galvao-filma-eu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=manhe-to-na-globo-galvao-filma-eu</link>
		<comments>http://www.semtexgirl.net/2011/03/25/manhe-to-na-globo-galvao-filma-eu/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 19:37:19 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[Sem categoria]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=162</guid>
		<description><![CDATA[Tweet este post]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.semtexgirl.net/wp-content/uploads/2011/03/Globo-11-Anos.png" rel="lightbox[162]"><img class="aligncenter size-medium wp-image-161" title="Globo - 11 Anos" src="http://www.semtexgirl.net/wp-content/uploads/2011/03/Globo-11-Anos-300x197.png" alt="" width="300" height="197" /></a></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Manh%C3%AA%21+T%C3%B4+na+Globo%21%21%21+Galv%C3%A3o+filma+eu%21+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D162" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Manh%C3%AA%21+T%C3%B4+na+Globo%21%21%21+Galv%C3%A3o+filma+eu%21+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D162" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2011/03/25/manhe-to-na-globo-galvao-filma-eu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modelos profissionais</title>
		<link>http://www.semtexgirl.net/2010/05/01/modelos-profissionais/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=modelos-profissionais</link>
		<comments>http://www.semtexgirl.net/2010/05/01/modelos-profissionais/#comments</comments>
		<pubDate>Sat, 01 May 2010 16:06:55 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[globo.com]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=152</guid>
		<description><![CDATA[Sempre gostei de me espelhar em modelos, pessoas com as quais trabalhei e que conquistaram a minha admiração e respeito. Entre tantos que já conheci existe um que me marcou profundamente, Jorge Ogawa, meu gerente na época em que eu trabalhava no Itaú, como todo mundo ele não acertava sempre, as vezes tomava decisões que [...]]]></description>
			<content:encoded><![CDATA[<p>Sempre gostei de me espelhar em modelos, pessoas com as quais trabalhei e que conquistaram a minha admiração e respeito. Entre tantos que já conheci existe um que me marcou profundamente, <strong>Jorge Ogawa</strong>, meu gerente na época em que eu trabalhava no <strong>Itaú</strong>, como todo mundo ele não acertava sempre, as vezes tomava decisões que me deixavam chateada mas no geral ele sempre foi e ainda é a  minha inspiração.</p>
<p>Quando comecei a trabalhar com gestão de equipe comecei a dizer a mim mesma, espero um dia ser para a minha equipe ao menos metade do que o Jorge foi pra mim. Ele é um grande líder, exigente, sempre soube quando elogiar ou puxar a orelha de alguém da equipe, sempre se preocupou com a evolução técnica e pessoal de todos.</p>
<p>Muitas vezes no meu dia-a-dia quando me encontro em situações complicadas com a minha equipe eu paro e penso, o que o Jorge faria no meu lugar? E tento imaginar e encontrar uma solução inspirada no que aprendi com ele.</p>
<p>Porem esta semana aconteceu algo curioso, eu estava um pouco chateada com uma série de coisas, estava questionando a qualidade do meu trabalho,  questionando tudo que tenho feito na globo.com e não conseguia ver nenhum  resultado relevante, e ontem cheguei a comentar com alguns poucos amigos que talvez eu saísse da empresa, pois eu não estava conseguindo atingir minhas metas pessoais, e contei sobre o meu modelo profissional e que eu estava me questionando se de fato eu tinha conseguido aprender alguma coisa com o ele. Porem, no final do dia recebi um e-mail de alguém de uma das equipes que trabalhei na Globo.com que vou transcrever abaixo:</p>
<blockquote><p><em>Andréia,</em></p>
<p><em>Sinceramente, queria muito que você ficasse aqui conosco, por tudo que você já fez e na minha humilde opinião, por tudo que você representa.</em></p>
<p><em>Acho que, pelo menos para algumas pessoas daqui de dentro, você é o ultimo símbolo de esperança de alguma mudança na globo. E com a sua saída, essa esperança vai por água a baixo.</em></p>
<p><em>Mas, obviamente que eu sei que você tem que seguir seus princípios e sua vontade mas sinceramente, ainda tenho uma esperança que você fique.</em></p>
<p><em>E ficando ou não, eu queria repetir uma frase que você falou ainda a pouco...</em></p>
<p><em>Se um dia eu puder exercer um cargo de gerência em alguma empresa, e se eu for metade do que você é, sinceramente estarei mega feliz.</em></p>
<p><em>Não quero que você veja essas palavras apenas como palavras de uma pessoa que gosta de você, quero que você as veja como palavras de uma pessoa que te admira bastante e te tem como um ótimo exemplo a se seguir.</em></p></blockquote>
<p>Confesso que fiquei um bocado emocionada, pois sei que é muito difícil fazer a diferença na vida de alguém e saber que de alguma forma eu consegui fazer isso, me encheu de esperança e me fez ver as coisas de um outro ponto de vista e que as vezes a gente não consegue ver o resultado do nosso trabalho, pois ser Scrum Master é um trabalho de formiguinha, todo dia você tenta mudar uma coisinha e torce para que isso dê resultado, e muitas vezes o resultado não é visível a curto prazo, nem para mim nem para os outros.</p>
<p>Sendo assim agradeço publicamente a pessoa que mandou ao e-mail,  e fecho dizendo que não consigo expressar o quanto este e-mail significou pra mim. E agradeço ao meu amigo e "ex-chefinho" Jorge Ogawa, pelos 5 anos que tive o prazer e a honra de trabalhar ao seu lado.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Modelos+profissionais+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D152" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Modelos+profissionais+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D152" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2010/05/01/modelos-profissionais/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyActiveMQ + Mac OS X Snow Leopard</title>
		<link>http://www.semtexgirl.net/2010/01/15/pyactivemq-mac-os-x-snow-leopard/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pyactivemq-mac-os-x-snow-leopard</link>
		<comments>http://www.semtexgirl.net/2010/01/15/pyactivemq-mac-os-x-snow-leopard/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 03:39:14 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[technical]]></category>
		<category><![CDATA[ActiveMQ-CPP]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[Mac OS X Snow Leopard]]></category>
		<category><![CDATA[PyActiveMQ]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=125</guid>
		<description><![CDATA[Só uma dica, para o tutorial de instalação/compilação do activemq no Leopard funcionar com o Snow Leopard, depois que executar o passo 2 faça o seguinte: cd /System/Library/Frameworks/Python.framework/Versions/ mv 2.6 2.6Old sudo ln -s /opt/local/Library/Frameworks/Python.framework/Versions/2.6 2.6 E depois executar os demais passos... a dica acima tambem serve para o python 2.5 rodando no Leopard ou [...]]]></description>
			<content:encoded><![CDATA[<p>Só uma dica, para o <a href="http://www.semtexgirl.net/2009/07/24/compilando-o-pyactivemq-activemq-cpp-no-mac-os-x-leopard/">tutorial de instalação/compilação do activemq no Leopard</a> funcionar com o Snow Leopard, depois que executar o passo 2 faça o seguinte:</p>
<blockquote>
<pre class="bash"><span style="color: #7a0874; font-weight: bold;">cd</span> /System/Library/Frameworks/Python.framework/Versions/
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000;">2.6</span> <span style="color: #000000;">2</span>.6Old
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> -s /opt/<span style="color: #7a0874; font-weight: bold;">local</span>/Library/Frameworks/Python.framework/Versions/<span style="color: #000000;">2.6</span> <span style="color: #000000;">2.6</span></pre>
</blockquote>
<p>E depois executar os demais passos... a dica acima tambem serve para o python 2.5 rodando no Leopard ou Snow Leopard.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=PyActiveMQ+%2B+Mac+OS+X+Snow+Leopard+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D125" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=PyActiveMQ+%2B+Mac+OS+X+Snow+Leopard+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D125" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2010/01/15/pyactivemq-mac-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UnicodeDecodeError: &#039;ascii&#039; codec can&#039;t decode byte 0xc3</title>
		<link>http://www.semtexgirl.net/2009/07/30/unicodedecodeerror-ascii-codec-cant-decode-byte-0xc3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=unicodedecodeerror-ascii-codec-cant-decode-byte-0xc3</link>
		<comments>http://www.semtexgirl.net/2009/07/30/unicodedecodeerror-ascii-codec-cant-decode-byte-0xc3/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:54:12 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[technical]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=114</guid>
		<description><![CDATA[Problemas com unicode? Vá no diretório &#60;python_home&#62;/lib/python2.6/site-packages/ e crie um novo arquivo com o nome sitecustomize.py com o conteúdo abaixo: import sys sys.setdefaultencoding('utf-8') Prontinho problema resolvido! Tweet este post]]></description>
			<content:encoded><![CDATA[<p>Problemas com unicode?</p>
<p>Vá no diretório &lt;python_home&gt;/lib/python2.6/site-packages/ e crie um novo arquivo com o nome sitecustomize.py com o conteúdo abaixo:</p>
<blockquote><p><code>import sys<br />
sys.setdefaultencoding('utf-8') </code></p></blockquote>
<p>Prontinho problema resolvido!</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=UnicodeDecodeError%3A+%27ascii%27+codec+can%27t+decode+byte+0xc3+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D114" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=UnicodeDecodeError%3A+%27ascii%27+codec+can%27t+decode+byte+0xc3+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D114" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2009/07/30/unicodedecodeerror-ascii-codec-cant-decode-byte-0xc3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compilando o PyActiveMQ + ActiveMQ-CPP no Mac OS X Leopard</title>
		<link>http://www.semtexgirl.net/2009/07/24/compilando-o-pyactivemq-activemq-cpp-no-mac-os-x-leopard/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=compilando-o-pyactivemq-activemq-cpp-no-mac-os-x-leopard</link>
		<comments>http://www.semtexgirl.net/2009/07/24/compilando-o-pyactivemq-activemq-cpp-no-mac-os-x-leopard/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 02:56:51 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[technical]]></category>
		<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[ActiveMQ-CPP]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[Mac OS X Leopard]]></category>
		<category><![CDATA[PyActiveMQ]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=102</guid>
		<description><![CDATA[Finalmente consegui compilar o PyActiveMQ + ActiveMQ-CPP no meu Mac. Uma boa parte do trabalho eu fiz via Mac Port, vou colocar o passo-a-passo abaixo para caso alguem precise fazer o mesmo. Pré-requistos: X11 Apple's Xcode Developer Tools MacPorts 1.710 apr-util 1.3.8 update do will: http://archive.apache.org/dist/apr/apr-1.3.8.tar.gz http://archive.apache.org/dist/apr/apr-util-1.3.8.tar.gz Para saber o que você ja tem instalado [...]]]></description>
			<content:encoded><![CDATA[<p>Finalmente consegui compilar o PyActiveMQ + ActiveMQ-CPP no meu Mac. Uma boa parte do trabalho eu fiz via Mac Port, vou colocar o passo-a-passo abaixo para caso alguem precise fazer o mesmo.</p>
<p><strong>Pré-requistos:</strong></p>
<ul>
<li> X11</li>
<li>Apple's Xcode Developer Tools</li>
<li>MacPorts 1.710</li>
<li>apr-util 1.3.8</li>
</ul>
<p>update do will:</p>
<p><a title="apr-util-1.3.8" href="http://archive.apache.org/dist/apr/apr-1.3.8.tar.gz http://archive.apache.org/dist/apr/apr-util-1.3.8.tar.gz" target="_blank">http://archive.apache.org/dist/apr/apr-1.3.8.tar.gz</a><br />
<a href="http://archive.apache.org/dist/apr/apr-util-1.3.8.tar.gz" target="_blank">http://archive.apache.org/dist/apr/apr-util-1.3.8.tar.gz</a></p>
<p>Para saber o que você ja tem instalado basta utilizar o comando abaixo:</p>
<blockquote><p><code>sudo port installed</code></p></blockquote>
<p><strong>1)</strong> Atualizando o port:</p>
<blockquote><p><code>sudo port -v selfupdate</code></p></blockquote>
<p><strong>2)</strong> Instalando o python 2.6</p>
<blockquote><p><code>sudo port install python26<br />
sudo port install python_select<br />
sudo python_select python26</code></p></blockquote>
<p><strong>3)</strong> Instalando o Boost com suporte para o Python26</p>
<blockquote><p><code>sudo port install boost +python26</code></p></blockquote>
<p>Dica importante... este processo demora um bocado... portanto de um volta, tome um café, leia algum blog e por ai vai.</p>
<p><strong>4)</strong> Compilando o ActiveMQ-CPP</p>
<blockquote><p><code>svn co https://svn.apache.org/repos/asf/activemq/activemq-cpp/tags/activemq-cpp-2.2.6 activemq-cpp-2.2.6<br />
cd activemq-cpp-2.2.6<br />
./autogen.sh<br />
./configure --prefix=/opt/activemq-cpp<br />
make<br />
sudo make install<br />
</code></p></blockquote>
<p><strong>5)</strong> Compilando o PyActiveMQ</p>
<blockquote><p><code>svn co http://pyactivemq.googlecode.com/svn/tags/pyactivemq-0.1.0 pyactivemq-0.1.0<br />
cd pyactivemq-0.1.0<br />
</code></p></blockquote>
<p>Abra o arquivo setup.py e faça as seguintes alterações:<br />
de:</p>
<blockquote><p><code>libraries = [<br />
'libactivemq-cpp',<br />
'apr-1',<br />
'aprutil-1',<br />
'apriconv-1',<br />
'uuid',<br />
'ws2_32',<br />
'rpcrt4',<br />
'mswsock',<br />
'advapi32',<br />
'shell32'<br />
]<br />
</code></p></blockquote>
<p>para:</p>
<blockquote><p><code>libraries = [<br />
'libactivemq-cpp',<br />
'apr-1',<br />
'aprutil-1',<br />
'apriconv-1',<br />
#'uuid',<br />
'ws2_32',<br />
'rpcrt4',<br />
'mswsock',<br />
'advapi32',<br />
'shell32'<br />
]<br />
</code></p></blockquote>
<p>de:</p>
<blockquote><p><code>include_dirs = [<br />
'/opt/activemq-cpp-2.2.1/include/activemq-cpp-2.2.1'<br />
]<br />
libraries = [<br />
'activemq-cpp',<br />
'uuid',<br />
'boost_python'<br />
]<br />
extra_compile_args = []<br />
extra_link_args = [<br />
'-Wl,-rpath,/opt/activemq-cpp-2.2.1/lib'<br />
]<br />
</code></p></blockquote>
<p>para:</p>
<blockquote><p><code>include_dirs = [<br />
'/opt/activemq-cpp/include/activemq-cpp-2.2.6',<br />
'/opt/local/include'<br />
]<br />
libraries = [<br />
'activemq-cpp',<br />
#'uuid',<br />
'boost_python-mt'<br />
]<br />
library_dirs = [<br />
'/opt/activemq-cpp/lib'<br />
]<br />
extra_compile_args = []<br />
extra_link_args = [<br />
'-Wl,-rpath,/opt/activemq-cpp/lib'<br />
]<br />
</code></p></blockquote>
<p>python setup.py build<br />
sudo python setup.py install</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Compilando+o+PyActiveMQ+%2B+ActiveMQ-CPP+no+Mac+OS+X+Leopard+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D102" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Compilando+o+PyActiveMQ+%2B+ActiveMQ-CPP+no+Mac+OS+X+Leopard+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D102" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2009/07/24/compilando-o-pyactivemq-activemq-cpp-no-mac-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Desejar trabalhar de forma ágil? Venha para a Globo.com!</title>
		<link>http://www.semtexgirl.net/2009/05/15/globocom-contrata/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=globocom-contrata</link>
		<comments>http://www.semtexgirl.net/2009/05/15/globocom-contrata/#comments</comments>
		<pubDate>Fri, 15 May 2009 14:24:18 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[globo.com]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[contrata]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=88</guid>
		<description><![CDATA[A Globo.com continua crescendo, inovando e se transformando! Devido a isso, estamos procurando por um Desenvolvedor (experiente e versátil) com sólidos conhecimentos teóricos de computação e capacidade de adaptação para integrar um de nossos times no GloboEsporte.com. Procuramos pessoas com espírito inovador, curiosidade, paixão por tecnologia e talento, que se empolgam com construir grandes softwares [...]]]></description>
			<content:encoded><![CDATA[<p>A Globo.com continua crescendo, inovando e se transformando!</p>
<p>Devido a isso, estamos procurando por um Desenvolvedor (experiente e versátil) com sólidos conhecimentos teóricos de computação e capacidade de adaptação para integrar um de nossos times no GloboEsporte.com. Procuramos pessoas com espírito inovador, curiosidade, paixão por tecnologia e talento, que se empolgam com construir grandes softwares com grandes pessoas. Que acredite que ajudar a criar e distribuir um produto é importante. Nós também procuramos pessoas que pensam sobre o que nossos clientes gostariam de ter, que focam no sucesso do produto e do negócio e não se deixam levar em guerras religiosas sobre processos de desenvolvimento.</p>
<p>Hoje grande parte de nossos aplicativos são desenvolvidos em Java e Python, mas encorajamos o contato de desenvolvedores que dominem outras tecnologias de desenvolvimento web, pois apreciamos visões diferentes e diversidade de conhecimento e acreditamos que um bom desenvolvedor poderá estudar as tecnologias que utilizamos e dominá-las rapidamente.</p>
<p>Prezamos a colaboração e a constante busca pelo aperfeiçoamento.</p>
<p><strong>Nossos Desenvolvedores devem ser capazes de:</strong></p>
<ul>
<li>Trabalhar em equipe e ouvir a equipe;</li>
<li>Colocar suas idéias e valores de maneira clara e objetiva;</li>
<li>Expor suas opniões com segurança e baseadas em fundamentos;</li>
<li>Desenvolver módulos para integração com serviços web;</li>
<li>Projetar e programar a aplicação em camadas visando modularização;</li>
<li>Elaborar as melhores estratégias de implementação para reduzir o custo de manutenção do produto;</li>
<li>Aprimorar o ambiente de desenvolvimento automatizando processos repetitivos;</li>
<li>Estimar o tempo de desenvolvimento das atividades;</li>
<li>Dividir as atividades (Visões do Cliente) em tarefas;</li>
<li>Escolher as tarefas para desenvolvimento;</li>
<li>Atualizar o status de suas atividades diariamente;</li>
<li>Participar das reuniões de planejamento de iteração e release, reviews e retrospectivas com os demais integrantes do time, clientes e usuários;</li>
<li>Desenvolver os produtos de software;</li>
<li>Elaborar a arquitetura e esquema lógico dos dados quando necessário;</li>
<li>Implementar testes de unidade, aceitação, integração;</li>
<li>Trabalhar com ferramentas para Gerência de Configuração de Software (ex.: SVN, GIT e várias outras SCM suites);</li>
<li>Refatorar constantemente para manter o código limpo;</li>
<li>Integrar freqüentemente com o repositório porém sem descuidar de requisitos mínimos como executar os testes;</li>
<li>Revisar o código:
<ul>
<li>Trabalhar em par;</li>
<li>Outro desenvolvedor faz uma revisão antes da integração.<il></ul>
</li>
</ul>
<p><strong>É necessário ter experiência comprovada em:</strong></p>
<ul>
<li>Desenvolvimento multi-camadas usando tecnologias tais como EJB ou Hibernate;</li>
<li>Desenvolvimento de aplicações Java™ J2EE no ambiente da Web;</li>
<li>Implementação de testes unitários em JUnit e DBUnit;</li>
<li>Processos e Threads;</li>
<li>Redes;</li>
<li>Linguagens XML e SQL;</li>
<li>Ter sólidos conhecimentos de Engenharia de Software;</li>
<li>OO, MVC, Design Patterns;</li>
<li>Métodos e estratégias de depuração;</li>
<li>Um ou mais servidores de aplicação Java™: Tomcat, JBoss, Bea Weblogic e Jetty;</li>
<li>Bancos de dados: Oracle 9i/10g e MySQL.</li>
</ul>
<p><strong>É importante saber do que se trata e como funciona:</strong></p>
<ul>
<li>Subversion;</li>
<li>Git;</li>
<li>Test Driven Development (TDD);</li>
<li>SOA;</li>
<li>Web Services (SOAP, XML-RPC, REST);</li>
<li>Javascript, JQuery, Ajax, Template Engines;</li>
<li>CSS2, CSS3, HTML, DHTML e XSLT;</li>
<li>Scrum.</li>
</ul>
<p><strong>É desejável conhecer:</strong></p>
<ul>
<li>Linguagens de script (Shell Script, Perl...);</li>
<li>Linguagens dinâmicas, preferencialmente Python.</li>
</ul>
<p>Nós da Globo.com, buscamos criar o melhor ambiente possível, pois acreditamos que o segredo do sucesso de um time está nas pessoas e não nas ferramentas. Por isso, adotamos o Manifesto Ágil e quaisquer idéias que promovam a melhoria dos processos para o desenvolvimento de software. Oferecemos contratação apenas no regime CLT, com salário de mercado e um bom plano de benefícios. Nosso escritório fica localizado na Barra da Tijuca na cidade do Rio de Janeiro e damos suporte a pessoas de outros estados que queiram se mudar. Se você se sente capaz de encarar este desafio, envie seu currículo para andreia at corp dot globo dot com, com o valor pretendido e uma breve descrição do seu interesse pela oportunidade e sua aptidão.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Desejar+trabalhar+de+forma+%C3%A1gil%3F+Venha+para+a+Globo.com%21+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D88" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Desejar+trabalhar+de+forma+%C3%A1gil%3F+Venha+para+a+Globo.com%21+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D88" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2009/05/15/globocom-contrata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Software Development Best Practices 2008</title>
		<link>http://www.semtexgirl.net/2008/10/23/software-development-best-practices-2008/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=software-development-best-practices-2008</link>
		<comments>http://www.semtexgirl.net/2008/10/23/software-development-best-practices-2008/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 16:05:54 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[globo.com]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[Best Practices]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=73</guid>
		<description><![CDATA[O <a href="http://sdbestpractices.com/">SD Best Practices</a> é uma conferência onde os principais players da comunidade de desenvolvimento de software se reúnem para aprender sobre as últimas tecnologias, e se encontram com os principais vendedores da indústria.]]></description>
			<content:encoded><![CDATA[<p>O <a href="http://sdbestpractices.com/">SD Best Practices</a> é uma conferência onde os principais players da comunidade de desenvolvimento de software se reúnem para aprender sobre as últimas tecnologias, e se encontram com os principais vendedores da indústria. A conferência é um treinamento centrado em fornecer as ferramentas necessárias para adoação com êxito em seus projetos das melhores práticas de design, qualidade e técnicas de gerenciamento de projeto.</p>
<p>Com uma programação com 142 sessões apresentadas em 6 formatos (Birds-of-a-Feather Gathering, Estudo de Caso, Classe, Experimental, Mesa Redonda, Tutorial) separados em 10 tracks( Algoritmos Avançados & Conceitos, Processo Ágil & Metodologia, C++, Design & Arquitetura, Linguagem & Implementação, Pessoas, Projetos & Times, Requisitos & Analise, Secure Design, Teste & Qualidade, Web Services/SOA) o SD Best Practices é uma maratona de 5 dias que começa na próxima segunda-feira, 27 de outubro e termina na sexta-feira dia 30 de outubro das 8:30 as 17:00</p>
<p>Solicitação aprovada, passagens compradas, hotel reservado, visto aprovado, agora é fato, Boston aqui vou eu!</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Software+Development+Best+Practices+2008+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D73" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Software+Development+Best+Practices+2008+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D73" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2008/10/23/software-development-best-practices-2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fotografia</title>
		<link>http://www.semtexgirl.net/2008/03/21/fotografia/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fotografia</link>
		<comments>http://www.semtexgirl.net/2008/03/21/fotografia/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 03:30:48 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[photography]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=66</guid>
		<description><![CDATA[Para quem ainda não sabe comecei a fazer o curso de fotografia da Escola Panamericana de Artes ;o), sendo assim acredito que devo voltar a escrever, porem o assunto provavelmente será este. Eu ainda continuo trabalhando com TI e tenho começado a usar scrum nos projetos que estou coordenando o que tem dado ótimos resultados, [...]]]></description>
			<content:encoded><![CDATA[<p>Para quem ainda não sabe comecei a fazer o curso de fotografia da Escola Panamericana de Artes ;o), sendo assim acredito que devo voltar a escrever, porem o assunto provavelmente será este. Eu ainda continuo trabalhando com TI e tenho começado a usar scrum nos projetos que estou coordenando o que tem dado ótimos resultados, mas nunca arrumo tempo pra escrever sobre isso ;o/</p>
<p>Bem, é isso ai pessoal!</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Fotografia+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D66" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Fotografia+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D66" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2008/03/21/fotografia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sobre gerenciamento de projetos</title>
		<link>http://www.semtexgirl.net/2007/02/23/sobre-gerenciamento-de-projetos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sobre-gerenciamento-de-projetos</link>
		<comments>http://www.semtexgirl.net/2007/02/23/sobre-gerenciamento-de-projetos/#comments</comments>
		<pubDate>Fri, 23 Feb 2007 20:45:27 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=64</guid>
		<description><![CDATA[Empresas americanas gastam mais de US$275 bilhões a cada ano em projetos de desenvolvimento de software aplicativo. Muitos desses projetos falharão, mas não por falta de dinheiro ou tecnologia; a maioria falhará por falta de um gerenciamento de projetos habilidoso. Tweet este post]]></description>
			<content:encoded><![CDATA[<p>Empresas americanas gastam mais de US$275 bilhões a cada ano em projetos de desenvolvimento de software aplicativo. Muitos desses projetos falharão, mas não por falta de dinheiro ou tecnologia; a maioria falhará por falta de um gerenciamento de projetos habilidoso.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Sobre+gerenciamento+de+projetos+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D64" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Sobre+gerenciamento+de+projetos+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D64" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2007/02/23/sobre-gerenciamento-de-projetos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aumentando o desempenho ao acessar arrays e os membros de um objeto</title>
		<link>http://www.semtexgirl.net/2007/01/10/aumentando-o-desempenho-ao-acessar-arrays-e-os-membros-de-um-objeto/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=aumentando-o-desempenho-ao-acessar-arrays-e-os-membros-de-um-objeto</link>
		<comments>http://www.semtexgirl.net/2007/01/10/aumentando-o-desempenho-ao-acessar-arrays-e-os-membros-de-um-objeto/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 12:35:17 +0000</pubDate>
		<dc:creator>Andréia Bustamante</dc:creator>
				<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.semtexgirl.net/?p=63</guid>
		<description><![CDATA[Ao desenvolvermos uma aplicação em JNI o acesso aos membros de uma classe é normalmente realizado através das próprias funções JNI, em vez de permitir acesso direto aos membros nativos. Este procedimento tem uma vantagem e um inconveniente: • Vantagem: Os objetos apontados por referencias são visto de forma simples pelo programador. • Inconveniente: Impacto [...]]]></description>
			<content:encoded><![CDATA[<p>Ao desenvolvermos uma aplicação em JNI o acesso aos membros de uma classe é normalmente realizado através das próprias funções JNI, em vez de permitir acesso direto aos membros nativos. Este procedimento tem uma vantagem e um inconveniente:</p>
<p>•	Vantagem: Os objetos apontados por referencias são visto de forma simples pelo programador.<br />
•	Inconveniente: Impacto no desempenho</p>
<p>Este impacto no desempenho se vê atenuado com a utilização de métodos nativos apenas para realizar funções não triviais, é por este motivo que não costumamos usa-los para realizar operações triviais, exceto é claro em exemplos como neste artigo.</p>
<p><strong>Desempenho acessando arrays</strong></p>
<p>Quando trabalhamos com arrays múltiplos não é viável o uso de função para acessarmos cada elemento de um array, no intuito de resolver este problema foi desenvolvida uma solução chamada ‘pinning’, que consiste em um método nativo que pede a maquina virtual que não remova da memória o conteúdo de um array, desta forma o método nativo pode obter o ponteiro que aponta diretamente para o conteúdo de um array. Esta solução, entretanto, tem duas implicações:</p>
<p>•	O garbage coletor deve suportar ‘pinning’. Em muitas implementações é inviável utilizar ‘pinning’ pois complica o garbage coletor e induz �  fragmentação da memória.<br />
•	A máquina virtual deve posicionar as primitivas contiguamente na memória. Embora esta seja a disposição natural para array de tipos primitivos, os arrays booleanos podem ser implementados como empacotados e desempacotados. Uma disposição booleana empacotado usa um bit para cada elemento, visto que desempacotado usa tipicamente um byte para cada elemento. Conseqüentemente, o código nativo que confia na disposição exata dos arrays booleanos perdera sua portabilidade.</p>
<p>E através das funções do tipo Get<tipo>ArrayElements() podemos apenas obter ponteiros de tipo primitivos de dados, os arrays de objetos devem ser acessados individualmente usando GetObjectArrayElement().</p>
<p>Ainda assim Get<tipo>ArrayElements() não nos garante a obtenção do  ponteiro do array original uma vez que ele cria uma cópia em outra área de memória, em resumo esta decisão depende de:</p>
<p>Que o garbage colector suporte “pinning”, no qual implica que o objeto não pode ser liberado ainda que não seja uma referência Java e para que o JNI o libere é preciso executar a função Release<tipo>ArrayElements().</p>
<p>A distribuição dos elementos de um array na memória, assim como o seu tamanho sejam os mesmos do C.</p>
<p>De outra forma o array será copiado para outra área de memória e será formatado convenientemente.</p>
<p>Atento ao fato de que só quando chamamos a função Release<tipo>ArrayElements() que a máquina virtual finaliza o pinning,  deixando livre uma cópia do array.</p>
<p>Outra solução que foi incorporada ao JSDK 1.2 as funções GetPrimitiveArrayCritical() e ReleasePrimitiveArrayCritical(), ao uso destas funções são recomendadas sempre que uma thread não:</p>
<p>•	Possuir um processo de tempo indefinido<br />
•	Chamar outras funções JNI<br />
•	Realizar uma operação “thread sleep” (suspensão da execução da thread por um tempo determinado)</p>
<p>Cumprindo estas condições a máquina virtual pode desativar temporariamente o garbage colector enquanto o método nativo acessa diretamente o array, sem que a máquina virtual use pinning. Isto aumenta a possibilidade da máquina virtual retornar o array original em vez de uma cópia.</p>
<pre class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* parametros.java */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Parametros <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">native</span> <span style="color: #993333;">int</span> soma<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> a, <span style="color: #993333;">int</span> b<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">native</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> texto<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> prompt<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">native</span> <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> somaArrays<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> A, <span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> B<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		Parametros parametros = <span style="color: #000000; font-weight: bold;">new</span> Parametros<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;4+6=&quot;</span> + parametros.<span style="color: #006600;">soma</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> string = parametros.<span style="color: #006600;">texto</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Digite algum texto&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;O texto digitado foi:&quot;</span> + string<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> A = <span style="color: #66cc66;">&#123;</span> <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">2</span>, <span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> B = <span style="color: #66cc66;">&#123;</span> <span style="color: #cc66cc;">4</span>, <span style="color: #cc66cc;">5</span>, <span style="color: #cc66cc;">6</span> <span style="color: #66cc66;">&#125;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #993333;">int</span><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> C = parametros.<span style="color: #006600;">somaArrays</span><span style="color: #66cc66;">&#40;</span>A, B<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>C == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Não foi possível realizar a soma.&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;O resultado da soma dos arrays é:&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i = <span style="color: #cc66cc;">0</span>; i &lt; C.<span style="color: #006600;">length</span>; i++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>C<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> + <span style="color: #ff0000;">&quot; &quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">static</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">loadLibrary</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;parametros&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<blockquote><p>Listagem 13: Código da classe Parametros.java</p></blockquote>
<p>Implementação em C.</p>
<pre class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">/* parametros.cpp */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">JNIEXPORT jintArray JNICALL Java_Parametros_somaArrays<span style="color: #66cc66;">&#40;</span>JNIEnv* env,</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">       jobject obj, jintArray arrayA, jintArray arrayB<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jintArray arrayC;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jint* A;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jint* B;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jint* C;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jsize i;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//Pegamos o tamanho de um dos arrays e comparamos</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	jsize tamanho = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetArrayLength<span style="color: #66cc66;">&#40;</span>env,ArrayA<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>tamanho!=<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetArrayLength<span style="color: #66cc66;">&#40;</span>env,arrayB<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">NULL</span>; <span style="color: #808080; font-style: italic;">//tamanho dos arrays são diferentes.</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #808080; font-style: italic;">//criação do array de retorno</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	arrayC = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;NewIntArray<span style="color: #66cc66;">&#40;</span>env, tamanho<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	A = <span style="color: #66cc66;">&#40;</span>jint*<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetPrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, arrayA, <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	B = <span style="color: #66cc66;">&#40;</span>jint*<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetPrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, arrayB, <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	A = <span style="color: #66cc66;">&#40;</span>jint*<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetPrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, arrayC, <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>; i &lt; tamanho; i++<span style="color: #66cc66;">&#41;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		C<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = A<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>+B<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;ReleasePrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, ArrayA,A, JNI_ABORT<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;ReleasePrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, ArrayB,B, JNI_ABORT<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;ReleasePrimitiveArrayCritical<span style="color: #66cc66;">&#40;</span>env, ArrayA,A, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">return</span> C;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<blockquote><p>Listagem 14: Código nativo parametros.cpp</p></blockquote>
<p>Por ultimo devo dizer que JNI garante o acesso concorrente ao array por várias threads, uma vez que o JNI mantém um controlador de pinnings, para que uma thread não finalize o pinning de um array que outra thread esta usando.</p>
<p><strong>Desempenho ao acessar os membros de um objeto</strong></p>
<p>Para obtermos o fieldID ou o methodID realizamos uma busca simbólica em uma base de nomes dos membros, o que é relativamente custoso. Uma forma de diminuir este custo quando houver necessidade de se busca-los mais de uma vez é cachear-los.</p>
<p>Para cachear podemos usar duas técnicas:</p>
<p><strong>1.</strong>Cachear em variáveis estáticas de uma função nativa, como por exemplo a função abaixo:</p>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">JNIEXPORT <span style="color: #993333;">void</span> JNICALL Java_MyClass_accessField<span style="color: #66cc66;">&#40;</span>JNIEnv *env, jobject obj<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #993333;">static</span> jfieldID fid_s = <span style="color: #000000; font-weight: bold;">NULL</span>; <span style="color: #808080; font-style: italic;">/* cacheando field ID para s */</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		jclass cls = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetObjectClass<span style="color: #66cc66;">&#40;</span>env, obj<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		jstring jstr;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #993333;">const</span> <span style="color: #993333;">char</span> *str;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>fid_s == <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			fid_s = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetFieldID<span style="color: #66cc66;">&#40;</span>env, cls, <span style="color: #ff0000;">&quot;s&quot;</span>,<span style="color: #ff0000;">&quot;Ljava/lang/String;&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>fid_s == <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">				<span style="color: #b1b100;">return</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Aplicação em C:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		jstr = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetObjectField<span style="color: #66cc66;">&#40;</span>env, obj, fid_s<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		str = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetStringUTFChars<span style="color: #66cc66;">&#40;</span>env, jstr, <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>str == <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #b1b100;">return</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot; c.s = <span style="color: #000099; font-weight: bold;">\&quot;</span>%s<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, str<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;ReleaseStringUTFChars<span style="color: #66cc66;">&#40;</span>env, jstr, str<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		jstr = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;NewStringUTF<span style="color: #66cc66;">&#40;</span>env, <span style="color: #ff0000;">&quot;123&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>jstr == <span style="color: #000000; font-weight: bold;">NULL</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">			<span style="color: #b1b100;">return</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;SetObjectField<span style="color: #66cc66;">&#40;</span>env, obj, fid_s, jstr<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li></ol></pre>
<blockquote><p>Listagem 15: Código nativo para cache em variáveis estáticas </p></blockquote>
<p><strong>2.</strong>Cachear ao inicializar uma classe, isso quer dizer que em um bloco estático podemos chamar uma função que inicializa todos os atributos e métodos que vamos precisar.</p>
<pre class="java"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyClass <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">native</span> <span style="color: #993333;">void</span> initIDs<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">native</span> <span style="color: #993333;">void</span> nativeMethod<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #993333;">void</span> callback<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Aplicação Java&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #993333;">void</span> main<span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> args<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		MyClass call = <span style="color: #000000; font-weight: bold;">new</span> MyClass<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		call.<span style="color: #006600;">nativeMethod</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #000000; font-weight: bold;">static</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">loadLibrary</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myclass&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">		initIDs<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<blockquote><p>Listagem 16: Código da classe MyClass, cache ao inicializar a classe.</p></blockquote>
<p>Implementação em C.</p>
<pre class="c"><ol><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">jmethodID MID_MyClass_callback;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">JNIEXPORT <span style="color: #993333;">void</span> JNICALL Java_MyClass_initIDs<span style="color: #66cc66;">&#40;</span>JNIEnv *env, jclass cls<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	MID_ MyClass_callback = <span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;GetMethodID<span style="color: #66cc66;">&#40;</span>env, cls, <span style="color: #ff0000;">&quot;callback&quot;</span>, <span style="color: #ff0000;">&quot;()V&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">JNIEXPORT <span style="color: #993333;">void</span> JNICALL Java_ MyClass_nativeMethod<span style="color: #66cc66;">&#40;</span>JNIEnv *env, jobject obj<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Aplicação C<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">	<span style="color: #66cc66;">&#40;</span>*env<span style="color: #66cc66;">&#41;</span>-&gt;CallVoidMethod<span style="color: #66cc66;">&#40;</span>env, obj,MID_MyClass_callback<span style="color: #66cc66;">&#41;</span>;</div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div></li><li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div></li></ol></pre>
<blockquote><p>Listagem 17: Código nativo que implementa o cache na inicialização da classe</p></blockquote>
<p>E logo initIDs() guarda os IDs em variáveis globais.<br />
Das duas técnicas a mais recomendada é a segunda por varias razões:</p>
<p><strong>1.</strong>Os IDs se tornam  inválidos logo que a classe é descarregada. Conforme o class loader descarrega a classe e ao se carregar a classe não se atualizam os IDs, na primeira solução porem o mesmo não acontece.</p>
<p><strong>2.</strong>É relativamente mais rápido uma vez que carregados os IDs não teremos que voltar a comprovar o valor do ID com:</p>
<pre>if (fid_s == NULL) {}</pre>
<p><strong>Diferenças de custo entre os objetos nativos e os métodos Java</strong></p>
<p>Neste tópico vamos comentar rapidamente qual o custo de se realizar uma chamada Java-nativo, nativo-Java (chamada callback), comparado com uma chamada java-java.</p>
<p>Uma chamada Java-nativo é mais lenta que uma chamada java-java porque:</p>
<p><strong>1.</strong>A máquina virtual tem que liberar as referências locais pra depois chamar o método nativo.<br />
<strong>2.</strong>A máquina virtual tem que buscar uma função dinâmica em sua biblioteca.<br />
<strong>3.</strong>A máquina virtual muitas vezes pode chamar in-line quando um método Java chama outro método Java.</p>
<p>Estima-se que o custo é de duas a três vezes superior ao de uma chamada java-java.<br />
Estima-se também que o custo de uma chamada nativo-Java (callback) é duas ou três vezes superior a uma chamada Java-Java. O principal custo agregado esta em:</p>
<p><strong>1.</strong>Obtenção do fieldID e do methodID<br />
<strong>2.</strong>E no acesso aos atributos através de funções, enquanto que a virtual machine pode acessá-los diretamente.</p>
<blockquote><p>
<strong>Para Saber Mais</strong><br />
Indicado pela Sun como fonte definitiva de informações sobre JNI.<br />
LIANG, Sheng. The Java Native Interface - Programmers Guide and Specification.<br />
Massachusetts: ADDISON-WESLEY, 1999. ISBN 0-201-32577-2.<br />
Pode ser baixado em:</p>
<p>http://java.sun.com/docs/books/jni/download/jni.pdf</p>
</blockquote>
<p><strong>Considerações Finais</strong></p>
<p>Neste artigo apresentamos uma visão geral de como se escrever aplicações híbridas envolvendo Java, JNI e bibliotecas dinâmicas nativas criadas a partir de código C. Abordamos algumas técnicas que podem ser utilizadas para facilitar a integração de sistemas legados. E, ainda uma breve visão de custo e melhoria de desempenho.</p>
<p>Como podemos perceber o JNI é uma ferramenta poderosa, contudo, é preciso estar ciente que uma aplicação Java chamando código nativo compromete a portabilidade e a segurança da aplicação. Pois, embora o bytecode Java compilado permaneça altamente portável, o código nativo deve ser recompilado para cada plataforma na qual se pretenda executar a aplicação.</p>
<p><strong>Referencias</strong></p>
<p>LIANG, Sheng. The Java Native Interface - Programmers Guide and Specification.<br />
Massachusetts: ADDISON-WESLEY, 1999. ISBN 0-201-32577-2.</p>
<p>LINDHOLM, Tim;YELLIN, Frank. Java The JavaTM Virtual Machine Specification.<br />
1999. Ultimo acesso em 17 de Julho de 2006. Disponível em:<br />
< http://java.sun.com/docs/books/vmspec/2nd-edition/html/VMSpecTOC.doc.html></p>
<p>MEAD, Matthew. Programmming in C/C++ with the Java Native Interface.<br />
1998. Ultimo acesso em 17 de Julho de 2006. Disponível em:<br />
< http://www.pacifier.com/~mmead/jni/cs510jip/index.html >.</p>
<p>SUN MICROSYSTEMS. Java Native Interface Specification.<br />
2003. Ultimo acesso em 17 de Julho de 2006. Disponível em:<br />
<http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/jniTOC.html></p>
<p>SUN MICROSYSTEMS. javap - The Java Class File Disassembler.<br />
2002. Ultimo acesso em 17 de Julho de 2006. Disponível em:<br />
< http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javap.html></p>
<p>SUN MICROSYSTEMS. javah - C Header and Stub File Generator.<br />
2002. Ultimo acesso em 17 de Julho de 2006. Disponível em:<br />
< http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javah.html></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Aumentando+o+desempenho+ao+acessar+arrays+e+os+membros+de+um+objeto+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D63" title="Post no twitter"><img class="img_tt" src="http://www.semtexgirl.net/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Aumentando+o+desempenho+ao+acessar+arrays+e+os+membros+de+um+objeto+http%3A%2F%2Fsemtexgirl.net%2F%3Fp%3D63" title="Post no twitter">Tweet este post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.semtexgirl.net/2007/01/10/aumentando-o-desempenho-ao-acessar-arrays-e-os-membros-de-um-objeto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

