Archive for the 'eclipse' Category

29
May
07

JAX India 2007- Bangalore – day 2

Let me first convey that i deeply regret for not attending the day-1 of the conference. I think the sessions there were more techy and geeky. It doesn’t automatically mean the day-2 sessions were not good. It felt better to hear the subject from their creators themselves. The time alloted to each subject(50 min) is not enough to go deep and thus satisfy the geekier crowd around but you get to hear on so many things in small time in bargain, so no repents. :) Add to it the fact that you usually don’t get such high profile speakers in conferences around India. Anyways, here are my take aways from the sessions i attended today. The slides for all presentations are available here.

Mylar: The tool and the framework (by Mik Kersten, CTO Tasktop)

  • Demonstrated the task ui from within Eclipse covering basic concepts of the tool and the idea behind its existence.
  • Connectors for OSS products like Bugzilla, Trac, Ant, Spring, SVN, CVS etc apart from quite a few for commercial tools from vendors like Telelogic, BEA, Atlassian etc.
  • Getting ready for 2.0 release with lots of emphasis on performance, search etc.

Best practices for inter-operable Web Services (by Thilo Frotscher)

  • Discusses two approaches to WS development – “Code-First” and “Contract-First”.
  • Code First : Start with java code and generate Schema, WSDL and other artifacts using tools. It leads to interoperability issues because the tools tend to use platform specific data types like Vector, DataSet etc which may not have a mapping data type in XML Schema.
  • Contract First : Create the schema first using the data types defined in xml schema (and creating complex types out of it). Generate WSDL using schema which sets the interface contract. Now use the interface and proceed to the code. Recommends usage of visual tools like Eclipse WTP 1.5 WSDL Editor.
  • Strongly discourages first approach and recommends use of contract first.
  • Newer tools and frameworks are moving towards POJO based WS development which essentially is a “code first” approach. However one can still bit little cautious and use them as they are lot mature and provide a relatively clean WSDL these days.
  • Use literal instead of encoded.
  • Dont rely on HTTP for transport. Do not use HTTP specific features like Cookies, SSL, HTTP Header etc.
  • Use SOAP header to store meta info.
  • Recomended reading on Web Services – Web Services Platform Architecture (by Sanjeeva W)

Tasktop, the task focused desktop (by Mik Kersten, CTO Tasktop)

  • Just a couple of weeks back i was thinking about task based contexts for my desktop and here it is, though not OSS or free. :( Take Google (or Yahoo) desktop search and add task based contexts (and related features) to it. thats your Tasktop. ;)
  • Natural extension of Mylar to Windows and Mac desktops for now. No plans for Linux as of now.
  • Comes both as Eclipse plugin and Eclipse RCP app.
  • Showcases its usage for a project manager who uses Google Cal, Outlook Mail, M$ Office, Bugzilla and Xplanner for his tasks and how Tasktop helps her reduce the clicks required to perform her daily tasks.
  • All others were mostly marketing stuff. However, just a thought from my side – Since it can store the action history including the browsing history, can this be potentially used to spy on young children’s adventures on internet?

Polyglot Programming (by Neal Ford, Thoughtworks)

  • catchy word – Yes i had not heard of it before as well. Well it simply means writing applications using multiple programming languages, each targeted towards specific problems which are best solved by that language.
  • We have been doing it anyways – Java + SQL + XML + JS? So whats new? Ruby :)
  • Pretty smart hand picked instances of java code which look problematic – using static initializer to display Hello World without even writing a main() method in java code, need to write class type multiple times in generics, recursive definition of Enum in javadoc, presence of Zero length arrays etc. Basically bashing static typing and advocating dynamic typing (a la Ruby).
  • Message was to view java as a combination of language and platform. The language is retarding / dieing but the platform is as beautiful as ever.
  • All in all the talk was very humorous and interesting. One statement that liked very much was – OR mapping is Vietnam of Computer Science. ;)

Shale framework : Taking JSF to next level (by Craig McClanahan, SUN Microsystems)

  • I must mention this – i was thoroughly impressed by his simplicity. His geeky looks reflected deep knowledge and responses to queries only floored people further. Sometimes i wonder if simplicity leads to greatness or greatness inspires simplicity.
  • An extension to JSF for a cleaner design, convention over configuration principle with annotation support, hollywood principle using callback methods for better encapsulation
  • Talked about features – dialog manager for conversation management, clay (similar to Facelets), view controller, ajax support using remoting etc.
  • Built-in unit testing framework, JNDI and Spring integration.
  • He was impressed with the approach of extending the components to business layer leveraging the EJB3 features by Seam framework.
  • Thinks that GWT puts too many restrictions on a developer for her to choose it for enterprise development.

Testing with Selenium (by Neal Ford, Thoughtworks)

  • Tool focused on acceptance testing of web application. Works by pushing a JavaScript based BrowserBot.
  • Either add it to your web app WEB-INF folder or use in remote mode. It needs test cases in html tables which can be either hand coded or recorded using SeleniumIDE FireFox plugin.
  • Explained few cool features like ajax testing, dynamic data in recorded scripts, standard red/green coloring of test runs etc.
  • Can not deal with non-JS accessible parts in page like applets, activex, flash content etc.

Over all, it was a tiring day. Sessions were mostly at an overview level than the depth. There was no time for QnA and it was a difficult choice between missing the next session or catching the speaker outside for questions.

09
Mar
07

Java Code Performance Analysis

Based on my experience and the maturity of tools and processes around Java applications, I can say that performance analysis of a Java code-base is a four prong process. One needs to perform all the four tasks to bring completeness to performance analysis on a code. Each of the steps in this process carries different weight based on its contribution towards improving the performance of the system. Lets look at the tasks involved.

Task 1: Static analysis of the code

This task involves a tool based generic check on the code for code quality, best practices and potential problematic code snippets. The tools can be customized to just check for the rules that impact the performance of the system. There are a lot of good open source tools available in this area which can run both as standalone and as Eclipse/Netbeans plugin. We recommend PMD, TPTP and FindBugs. I feel this task has a small contribution towards improvement of the performance of the system. Below i have attached a rule file that i derived from PMD which consists of rules that only check performance issues in the code.

PMD Rules

Task 2: Manual Code Review

This task involves a manual review of the code based on the best practices of the specific technology used in the code base, e.g Struts, there are best practices around Struts to make a Struts based application execute faster. One can create checklists of items that are industry accepted problematic areas in the framework and run it through the code. One should also try to automate this process by enhancing any of the tools mentioned in task 1 above. I feel this process also has a small contribution towards improvement of the performance of the system.

Task 3: Code Profiling

This task involves using a code profiler which keeps a watchful eye on a running code and keeps recording facts about it. The facts in turn help in analyzing the performance bottleneck areas in the code. There are quite a few open source tools in this area like Netbeans Profiler and Eclipse TPTP. Out of the commercial ones JProbe is recommended. We feel the results and findings of a profiler has a big impact on the overall performance improvement of the system. This task has significant contribution towards performance improvement of a code.

Task 4: Load / Stress test

This involves checking if the application really meets the defined performance requirements. There are good open source tools which assist in load testing both standalone and web based java applications. They enable us to simulate the load scenario expected in production application and hence tune the application to meet the expectations. I recommend JMeter. Again I feel this task also contributes significantly towards the performance improvement of the system.

If an application has external interfaces like database, queues, file system, third party systems etc the above process can still help us identify the impact due to the interfaces but there will be separate processes and tools to mitigate such impact.

One should look out for automating these tasks by integrating them into the IDE and/or build environment. The static analysis can be a IDE plugin running everytime the code changes. This helps detecting the issues early on. Similarly the code profiler should be integrated to IDE to help detect issues early on. The load tests can be automated and easily integrated with continuous integration tools.

02
Aug
06

Managing concurrent change with Eclipse and CVS

Many of the software projects developed today use distributed and collaborative development environments. Using geographically distributed team vendors are able to achieve ‘24/7 active’ development of their software. It has its own list of challenges and there are tools aplenty to address those challenges in both OSS and commercial category. Here we discuss one of such peculiar problem (i.e, managing concurrent changes to code base) and explain how Eclipse + CVS combination addresses it effectively.

Due to concurrent changes to the code and improper version control process (or lack of sincerity from developers) we almost always land up in ‘conflict’ situations and spend extra effort in resolving them. Below I discuss a process that helped me in a large development project while allowing me to just work with my development IDE. No extra tools required.

  1. CVS Features for managing concurrent change:

CVS provides various sets of features to help the users manage concurrent change effectively. These features work hand-in-hand to help the team. Some of these features are:

  • The “watch” feature: To utilize this feature the user explicitly expresses interest in change (edit/un-edit/commit) in a particular resource. CVS takes care of notifying the user whenever any user executes an operation of his interest on the resource viz. edit/un-edit (as explained below) and commit. This feature is not supported by the Eclipse’s VCM (Versioning and Configuration Management) modules’ CVS implementation as in Eclipse 2.1.
  • The “edit” feature: Typically any resource that needs change can follow any of the following paths under CVS:

cvs edit flow 1
The straight path (I) from an unchanged resource to the new committed resource is a common way of using CVS.

The alternate paths (IIa and IIb) are also supported by CVS and provide another mechanism to manage concurrent change.

If every user religiously follows path II to issue a “cvs edit” before (s)he starts work on a resource and then issues a “cvs commit” or a “cvs unedit” when work is respectively finished or needs to be rolled back, then CVS can keep track of all current “editor(s)” of a resource.

This conversely gives any other user who wants to work on the same resource an opportunity to check with CVS as to the current “editor(s)” of the resource and take appropriate steps. So the modified path II now becomes,

cvs edit flow 2

2. The Eclipse Value-Add:

Eclipse goes a step further to help you achieve this. Under Eclipse, a project can be set to send automatic “cvs edit” commands to the CVS repository whenever a resource is changed / “edit”-ed by a user. All resources for such a project get checked-out as “read-only”. When an actual change is made to the file from within Eclipse, Eclipse switches off the read-only flag and send the “cvs edit” command to the repository.

The story doesn’t end there! Eclipse goes even further. If it so happens that the file being “edit”-ed already has registered editors, Eclipse gives you a “warning” stating who is currently changing the file!!

As such both the manual steps of Path II viz. checking the “editors” of the resource and issuing the “edit” command are automatically taken care-of by Eclipse. All you need to ensure is that you work under Eclipse and respect the warnings – that’s all!!

3. What You Need to Do

  • Ensure that eclipse is setup to use edit and watch features.
  • Make sure that all files are edited under Eclipse
  • IFF (and that should not usually be necessary since Eclipse has editors for almost everything!) you do change anything outside Eclipse, make sure to send an explicit “cvs edit” command from Unix / WinCVS / Eclipse itself!
  • When Eclipse warns, don’t ignore. Consult with the existing “editor”.

PS: Special thanks to Sumit Sachdev for his contributions to this article.




History

Blog Stats

  • 126,505 views

Bookmarks