<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
<title>Giovani Salvador&apos;s Blog</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/" />
<modified>2008-05-22T16:27:04Z</modified>
<tagline></tagline>
<id>tag:weblogs.java.net,2008:/blog/giovanisalvador/437</id>
<generator url="http://www.movabletype.org/" version="3.01D">Movable Type</generator>
<copyright>Copyright (c) 2008, giovanisalvador</copyright>
<entry>
<title>Java Architectural Knowledge for Job Interviews. Are we prepared?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/archive/2008/05/i_already_inter.html" />
<modified>2008-05-22T16:27:04Z</modified>
<issued>2008-05-22T16:24:21Z</issued>
<id>tag:weblogs.java.net,2008:/blog/giovanisalvador/437.9846</id>
<created>2008-05-22T16:24:21Z</created>
<summary type="text/plain">In lots of job interviews I have participated as interviewer for Java positions it is clear the lack of architectural knowledge some developers have. Here I post a typical dialog between one developer and I and some considerations about it.
</summary>
<author>
<name>giovanisalvador</name>

<email>giovani.salvador@gmail.com</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/giovanisalvador/">
<![CDATA[<p>I already interviewed lots of Java developers during hiring activities. As part of the interview, besides other things, I like to understand if the person being interviewed has understanding of the applications he/she develops as a whole, I mean, not only understands business requirements but also understands the entire architecture of the application and, most important, why that specific architecture is in place for that application and its specific needs.</p>

<p>So below a typical dialog between a candidate (C) and I regarding architecture of a Java EE application.</p>

<p>- So, could you please describe, from your perspective, what should be a typical Java EE architecture for, let's say, a medium-size web-based application?<br />
C - Of course. Well, typically I will have in place a lightweight container like Spring and persistence mechanism like Hibernate. Spring will do everything for me.<br />
- Alright, let me be more specific, I believe my question was not well-built. Imagine if the end user is about to submit a form data. What will be the flow that data would take to be persisted in database? Describe to me the building blocks, all the path of the data, which objects will apply business rules, which objects will handle web requests, etc. Feel free to draw this architecture if you think it is better for you.<br />
C - Not necessary. Well, I would put Spring MVC in place to handle all the requests. For persistence, Spring DAO with Hibernate support.<br />
- hum, I think you haven't got the point. Forget about Spring. forget about EJBs. Forget about lightweight or heavyweight containers. Forget about Hibernate. Imagine you don't have these technologies to assist you. You have to propose the architecture without using any specific product. What would you do? Remember, no products. Just give me building blocks.<br />
C - .....<br />
C - .....<br />
C - In the presentation layer an object will take all data submitted and...<br />
- Which object?<br />
C - hum...... maybe a Servlet object or .....<br />
- Or a managed bean, something like this? Ok, go on. Once data is retrieved from the UI, what will happen?<br />
C - ... ok, data will be sent to an object and this object will perform business rules and after that data will be persisted.<br />
- Could you please be more specific? Do you have in mind any design pattern that could assist you for this architecture? What would be the structure for the domain layer? And Persistence layer?<br />
C - ...<br />
C - Man, I would work with Spring, it does all those things for me.<br />
- Alright, that's good for me. Thank you.</p>

<p><br />
Let me say somethings about this dialog.<br />
<strong>First</strong>: I don't have any problems with Spring. In <a href="http://weblogs.java.net/blog/giovanisalvador/archive/2008/03/java_and_the_ne.html">one of my posts</a> I said that I never used it because I never had to. We need to find solutions for our problems and not create problems for given solutions. By the way, comments in that post were great.</p>

<p><strong>Second</strong>: The candidate never asked how many transactions per minute, hour, etc, how many concurrent users, if it is a critical application. That dictates the architecture. We can't have silver bullet and it seems today most of the "architects" have silver bullets. And, even worst, relying on specific products. Also, based on the non-functional requirements of the application we could see if clustering would be needed. But no, no question about those kinds of things at all.</p>

<p><strong>Third</strong>: The lack of knowledge on some typical design patterns is also something to take into account. Façade? DAO? Value Objects? Application Controller? Even if we don't need all of them, candidates should be prepared to use them when necessary.</p>

<p><br />
I know it is hard in an job interview to remember all those things. And I really don't have answers for all problems, most of the times we just can't propose an architecture whitout digging deeper in the details, in the business requirements and having lots of discussions with peers and even business team.<br />
But as developers and architects we can't be relying on specific products, we need to be able to understand architecture as a whole and what are the options we have to better propose a scalable architecture and build a solid system.</p>

<p>Here a few basic references about all this stuff.</p>

<p><a href="http://java.sun.com/reference/blueprints/">Java BluePrints</a> - Here some good stuff for JAva Enterprise Applications.<br />
<a href="http://java.sun.com/blueprints/patterns/">Java EE Design Patterns</a>: Core J2EE patterns are here also<br />
<a href="http://books.google.com.br/books?id=FyWZt5DdvFkC&dq=patterns+of+enterprise+application+architecture&pg=PP1&ots=eExq0zXq9w&sig=6Uea3vkl8wUS2FhivHiMk-XST6I&hl=pt-BR&prev=http://www.google.com.br/search%3Fhl%3Dpt-BR%26q%3Dpatterns%2Bof%2Benterprise%2Bapplication%2Barchitecture%26btnG%3DPesquisar&sa=X&oi=print&ct=title&cad=one-book-with-thumbnail">Patterns of Enterprise Application Architecture</a>, from Martin Fowler.<br />
<a href="http://www.oreilly.com/catalog/9780596007126/">Head First Design Patterns</a>.</p>

<p>There are lots of other good books and articles. Please, feel free to comment here adding more references.<br />
Also, what do you think would be the basic understanding developers should have nowadays? Any other specific skill?<br />
</p>]]>

</content>
</entry>
<entry>
<title>Refactoring for Performance</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/archive/2008/04/refactoring_for.html" />
<modified>2008-04-28T15:36:15Z</modified>
<issued>2008-04-28T15:36:07Z</issued>
<id>tag:weblogs.java.net,2008:/blog/giovanisalvador/437.9615</id>
<created>2008-04-28T15:36:07Z</created>
<summary type="text/plain">Sometimes small modifications help applications to improve performance. Here an example on how a small modification helped a critical application to improve its performance without big refactorings.
</summary>
<author>
<name>giovanisalvador</name>

<email>giovani.salvador@gmail.com</email>
</author>
<dc:subject>Performance</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/giovanisalvador/">
<![CDATA[<p>I was working on a kind of Outlook entirely based on the web and written 100% in Java. I was part of a team responsible for maintaining that application for thousands of users and performance was a critical piece. Actually, still is a critical piece because the application still exists and it is there for almost ten years.<br />
I joined the team after the application has been released and being used for about 20,000. At that time, the team was not fully aware of helpful frameworks or design patterns that could help themselves to build a reliable, scalable software. Application was performing well but one of the parts of the application (a listing) was taking too long to process. Some users were complaining on that piece and I joined to help team specially on that part of the application.<br />
First thing I decided to do was to put in place some tool to help us understand what was going on. At that time my IDE was Jbuilder Enterprise Edition and I had a license of Optimizeit. By plugging in it to the application I quickly noticed that building and access to lots of HashMaps instances were the culprit. <br />
Then I had to understand the application's architecture:<br />
The data layer was responsible for processing SQL statements sent to it, create HashMap instances for each record found and add each instance to a collection. Each column of the records found turned to a pair of column name and value. </p>

<p>The problem was that the application didn't have in place Transfer Objects or Value Objects. It was relying on maps and the application was facing performance problems on building those maps and suffering when accessing get methods of those maps, specially in those days where the load was so huge. That's what Optimizeit was telling me.</p>

<p>So I decided to make a small refactoring in my local environment after assessing the application with Optimizeit. I switched from maps to Transfer Objects in all layers of that piece of the application. Instead of making maps and collection of maps I created Transfer Objects and made them being accessed by the listing page. The Facade was responsible for returning the collection of Transfer Objects instead of a collection of maps.</p>

<p>When I ran Optimizeit again I noticed a gain of 20% in performance. After showing the results to the team we decided to release to production after some tests in Development Environment.<br />
One day later I received a call from one of the users who originally complained about the performance:</p>

<p>- User: Hey, have you guys modified anything in the application?<br />
- Why Sir?<br />
- User: Because the listing is performing much better now.<br />
- Actually, we did sir. We did a small modification on that piece.<br />
- User: Alright, I will notify other users about that. Thanks for the  work performed.</p>

<p>You guys may be surprised with this. Today, almost all applications rely on Transfer Objects, not on hashmaps. But at that time, with the knowledge of the former team, that's what was being used. The bottom line here is that small modifications may affect user experience. We don't need to make big refactorings to achieve that. Simple is better.<br />
And you guys know the value of an user calling you to congratulate you. This is the most important piece.<br />
Also, to put in place profiling tools like the one I had used is also key for the success of the project. You guys may be surprised with lots of things such tools may reveal about your code.</p>

<p>but I would like to know from you:<br />
Has any of you some example on small refactorings that made the difference? Simple modifications that helped applications to improve performance. Please, share over here some real world facts about refactoring.</p>

<p><br />
</p>]]>

</content>
</entry>
<entry>
<title>Java and the need for Dependency Injection</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/archive/2008/03/java_and_the_ne.html" />
<modified>2008-03-16T23:55:43Z</modified>
<issued>2008-03-16T23:55:35Z</issued>
<id>tag:weblogs.java.net,2008:/blog/giovanisalvador/437.9370</id>
<created>2008-03-16T23:55:35Z</created>
<summary type="text/plain">I was talking to some of my team mates in Austin regarding the usage of Spring as opposed to &quot;Heavy Weight Containers&quot;. They asked what I think about using Spring in the new features of an application they are working...</summary>
<author>
<name>giovanisalvador</name>

<email>giovani.salvador@gmail.com</email>
</author>
<dc:subject>Community: Java Enterprise</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/giovanisalvador/">
<![CDATA[I was talking to some of my team mates in Austin regarding the usage of <a href="http://www.springframework.org">Spring</a> as opposed to "Heavy Weight Containers". They asked what I think about using Spring in the new features of an application they are working on. I have to admit that I never used Spring. Why? Because I never had to. All that I needed to do was supported by EJB Containers or the so called Heavy Weight Containers. Maybe I don't how happy I can be if I use Spring but so far services provived by Java EE containers were enough. And with clustering!!!
<br><br>
I also have to admit that previous versions of EJBs were almost untestable (It's horrible to have to mock an EJB) but at the same time put business logic into EJB (here I am talking about Session and Message-driven EJBs) is something that I don't like that much. I always used POJOs for business logic also to be more testable. My EJBs just acted as a facade to provide remotability. Anyway, when I asked to one of them what was the need he answered me: "I want productivity with Dependency Injection". And more, he told they were going to use Spring integrated with the EJB Container to take advantage of the existing services provided by the container. What? Hum, a self-called lightweight container integrated with a heavyweight container. This sounds interesting. He wanted to have the advantages of dependency injection but also taking advantage of the container's services.
<br><br>
So here I don't take any conclusion despite I have my own opinion on using one or antoher. I just would like to know everybody's opinion on this. 
<br><br>
- How are you guys using Spring?<br>
- Has someone already integrated Spring and Java EE container? To take advantage of what?<br>
- And for those who are using only Spring, what are the pros and cons?<br>
- Are you using only the framework or also Spring Portfolio?<br>

I appreciate any comment on it.  :)
]]>

</content>
</entry>
<entry>
<title>Are we becoming Java Dinosaurs?</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/archive/2008/01/are_we_becoming.html" />
<modified>2008-01-07T17:17:46Z</modified>
<issued>2008-01-07T17:17:38Z</issued>
<id>tag:weblogs.java.net,2008:/blog/giovanisalvador/437.8934</id>
<created>2008-01-07T17:17:38Z</created>
<summary type="text/plain">When a developer starts to become a dinosaur for a programming language? Is Java in the process of making us dinosaurs?
</summary>
<author>
<name>giovanisalvador</name>

<email>giovani.salvador@gmail.com</email>
</author>
<dc:subject>Community</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/giovanisalvador/">
<![CDATA[<p>I was trying to think specifically when a developer, who codes in a specific programming language, is starting to become a dinosaur. It's not his/her age because there are lots of old guys working with new technologies and even creating them.<br />
But when I was reading <a href="http://www.artima.com/weblogs/viewpost.jsp?thread=221903">this post from Bruce Eckel</a> (it has been discussed <a href="http://www.theserverside.com/news/thread.tss?thread_id=47994">here</a> as well) I was thinking that when a technology stops doing new things then that technology is in process to make its "followers" as dinosaurs. Of course, Bruce Eckel is not fully suggesting Java should stop adding any feature. His point relates for adding features when we really need them.</p>

<p>But if Java starts the process of becoming, as he says, "stable" then does that mean we are becoming dinosaurs?<br />
 <br />
Let's analyze some things:</p>

<p>When a programming language stops adding support to new technologies then how that technology will have new people working with it? Imagine if Java has not provided any answer on SOA (through JBI or Web Services)!? Nowadays is all about SOA. But how would developers make their applications "<em>SOAble</em>" if they could not find in the language they are using a support for that feature? They would migrate to new programming languages or technologies that can offer such approach.<br />
Would the same developers create applications in that "old" language even if language support all the application's features? I don't think so. How many C/C++ applications are being <strong>created</strong> compared to technologies like Java and .Net?<br />
I don't have the answer but at least in the world I live I don't see that much (I would like to say none at all!!!).</p>

<p>Another interesting thing is that today in JCP, the number of JSRs in Review Stage is 0 and there is only one Early Draft Review.</p>

<p>If Java (JCP) starts the process of reducing the number of new features added to the language (or being "stable") then I really believe I am in the beginning of the process of becoming a Java dinosaur.</p>

<p><br />
</p>]]>

</content>
</entry>
<entry>
<title>JUG&apos;s challenges</title>
<link rel="alternate" type="text/html" href="http://weblogs.java.net/blog/giovanisalvador/archive/2007/12/jugs_challenge.html" />
<modified>2007-12-13T03:48:11Z</modified>
<issued>2007-12-13T03:29:19Z</issued>
<id>tag:weblogs.java.net,2007:/blog/giovanisalvador/437.8696</id>
<created>2007-12-13T03:29:19Z</created>
<summary type="text/plain">Java is a technology which has one of the most (if not the most) active community around the world. Java Users Groups organize events, meetings, all sort of activities with basically two goals: To promote and discuss Java technlogy. Bot how are JUGs organized? What are the challenges that JUGs face to achieve what they are intended to do? This post presents some of the problems JUGs face (at least JUGs I know in Brazil).
</summary>
<author>
<name>giovanisalvador</name>

<email>giovani.salvador@gmail.com</email>
</author>
<dc:subject>Community: Java User Groups</dc:subject>
<content type="text/html" mode="escaped" xml:lang="en" xml:base="http://weblogs.java.net/blog/giovanisalvador/">
<![CDATA[<p>I really don't know what are JUG's structures around the world (maybe you could provide me a feedback about it) but most JUGs in Brazil face almost the same problem: Coordinators who need to spend considerable time to work for the JUG. Let's not forget that working for a JUG, according to my opinion, should be volunteer job, which means that you are aware that sometimes need to spend your time and maybe some money to work for the JUG. </p>

<p>Some JUG's activities include:</p>

<p>- Build Strategic plan for the year<br />
- Organize affordable events<br />
- Make the link between community and job offers<br />
- Create and maintain a mailing list so community can share ideas.<br />
- Organize open meetings so community folks can join</p>

<p>As you can figure out, there is an considerable ammount of job to be done for the JUG. but what are the advantages for those who work for a JUG and don't receive any money for that?<br />
I can tell some:</p>

<p>- Visibility: As a JUG coordinator you join lots of important meetings with people who are interested in participate JUG's events<br />
- Networking: This is the most important for me. You know lots of people. You know directors, managers, developers and create a very good relationship with those people.<br />
- To keep yourself aware on what is happening in the Java world.</p>

<p>And what about money?<br />
No, you won't probably receive any money. Some JUGs are working together with User Groups organizations (In our JUG we work together with SUCESU, the main organization that represents lots of User Groups for IT) and saving some money as a result of events to somehow spend this money organizing more events or send some people from the community to larger events like <a href="http://java.sun.com/javaone/sf/">Javaone</a> and <a href="http://www.nofluffjuststuff.com/">No Fluff Just Stuff</a>.<br />
Maybe this is an approach that should work for most of the JUGs. In my case, our JUG is really needing some fuel to continue to work for the community as it did very well in a couple of years ago.<br />
I really believe JUGs should follow examples of SouJava and DFJUG, two of the most passioned JUGs in the world.<br />
But what else coudl we do? Maybe some new structure (what is your JUG's structure)? Maybe work closer to User Groups organizations or even Sun? <br />
What else? What do you you think? What about your JUG?</p>]]>

</content>
</entry>

</feed>