BayArea Eclipse DemoCamp roundup

I am excited to attend the much awaited DemoCamp and meet some Regional Community enthusiasts. Till now 21 got registered for the Regional Community and i am expecting this number to grow; i am sure that Bay Area has more companies working on Eclipse and its just the matter of time.

The DemoCamp started with the demo by Ingres Corporation – A quick tour of the Eclipse Data Tools Platform, which followed by an exciting presentation from Michael Galpin – Eclipse @ eBay.

img_0034

I gave a presentation + demo on the Single Source; Three Runtimes, which definitely excited many people in the DemoCamp.

Francis Upton gave a nice presentation on the Oakland Software Data Transformer.

img_0036

Oracle‘s Greg Stachnick gave a presentation and demo of the Oracle Enterprise Pack for Eclipse. I am definitely going to use this OEPE in future, it has nice WebLogic integration features.

img_0037

I met Randy Kerber and discussed EMF stuff and experiences. We are yet to find some users for EMF so that we can have some interesting discussions.

Last but not the least, i thank Ingres Corporation for organizing this DemoCamp (, beer and pizza’s too :)) where all Eclipse enthusiasts had an opportunity to share their experiences. Hoping to see more participation from the other Bay Area companies in future.

Happy Eclipse-ing.

Posted in eclipse, java, software, technology | Tagged , , , | Leave a comment

Eclipse DemoCamp in Bay Area : Redwood City

The much awaited DemoCamp is being organized by the Ingres Corporation in Bay Area, Redwood City. This is a very good opportunity for all the Bay Area Eclipse Regional Community members to meet and share their experiences. I am hoping to see all enthusiasts at the DemoCamp before Thanksgiving!!!

Visit DemoCamp’s website to get the event details and get registered :

http://wiki.eclipse.org/Eclipse_DemoCamps_November_2008/Redwood_City

Posted in eclipse, software, technology | Tagged , , | Leave a comment

Announcing : Bay Area Eclipse Regional Community

I am excited to announce the starting of the Bay Area Eclipse Regional Community (http://wiki.eclipse.org/Regional_Communities#USA). Thanks to all the Eclipse enthusiasts who responded to my post (http://sureshkrishna.wordpress.com/2008/09/09/regional-communities-in-silicon-valley). Many wanted to have a Regional Community to share their experiences in the Eclipse Eco System and hence is this effort to bring all of us together.

Request every Eclipse enthusiast in Bay Area to register for the news-groups at https://dev.eclipse.org/mailman/listinfo/bayarea-ec. There is also a Wiki Page for members to post the Upcoming Events, Jobs, Blog posts of members, etc… on http://wiki.eclipse.org/Regional_Communities/US/BayArea.

Posted in eclipse, software, technology | Tagged , , , | Leave a comment

RCP, RAP and eRCP : Single Code Base and Three Runtimes

Running an Eclipse application on Desktop, Web and mobile platform seems to be an exciting and challenging task for many. With a clear and crisp APIs, Eclipse made this task practical and easier. Chris Aniszczyk has already posted an example of Tic-Tac-Toe on his blog.

Recently me and Trebor (another eclipse enthusiast) have done an exercise to get a sample application on top of these three (rcp, rap and ercp) run-times with the Ganymede release. In this three part tutorial we built a simple Personal Organizer application and ran it on RCP, RAP and eRCP.

First Part goes through the necessary steps to create the application and run it as the Rich Client Platform (RCP) application.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt1.html

Second Part talks about the Rich Ajax Platform and how the existing code base of the sample RCP application can be adapted to run it on the RAP target.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt2.html

Third Part talks about the Embedded RCP and how to adapt the existing RCP code base to be able to run it on the eRCP.

http://www.ibm.com/developerworks/edu/os-dw-os-eclipse-ganymede-pt3.html

Hope these tutorials and insights will help a lot of developers to understand these platforms and know the possibilities. I will be happy to hear your experiences in making the single code base run on these three different platforms.

Till then Happy Eclipse-ing.

Posted in eclipse, java, software, technology | Tagged , , , , | Leave a comment

Attn : Eclipse Enthusiasts in Bay Area

After the Eclipse Day @ Googleplex, i was wondering if a similar thing can be organized in Bay Area. I understand that Googleplex event is a special one, however if anyone is interested, we can probably start a Regional Community in BayArea.

Please raise a hand if you are interested in sharing your thoughts, experiences and discussing the happenings in the Eclipse community. This is also an opportunity to meet Eclipse enthusiasts in Bay Area.

Send me a mail (suresh DOT madhuvarsu AT gmail DOT com) expressing your interest and I am glad to coordinate for future “Bay Area Eclipse Users Group”. If it’s too much of a work for me, perhaps i can get some help from Ian Skerrett 😉

Posted in eclipse, java, software, technology | Tagged , , | Leave a comment

Beware of writing regex and string functions

Recently i was involved in an issue took a week to come to know the root cause. In the end its an eye opener to many who does not give importance to string functions and regex. “Regular expressions and String functions are quite powerful in any language; however utmost importance should be given to such code.”

The issue is very simple. Set of Java Files need to processed to get some annotations and other proprietary stuff and also separate the main class names and inner class names. The customer created Business Entities which may contain inner classes and are passed through a pre-processor. Problem occurs in a particular case when the File name is “BlaSomeClassName_Bla.java” and it contains a inner class “SomeClass”.

–>Inner class name is SIMILAR to main class name.

Lets look at the following code and especially the line 6. This line tries to match the class names given by qdox (java source parser) with the java source file that is currently being processed.

1     if (classes.length == 1) {
2         _javaClass = classes[0];
3     } else {
4         for (int i = 0; i < classes.length; i++) {
5             JavaClass aClass = classes[i];
6             if (aSourceFile.getName().matches(".*" + aClass.getName() + ".*")) {
7                 _javaClass = classes[i];
8                 break;
9             }
10        }
11    }

This is the regular expression that took up my days and nights which rarely has any sort of consistency in execution. In the above example the source that is being processed is the “BlaSomeClassName_Bla.java” and the class names that you get from qdox will be “BlaSomeClassName_Bla” and “SomeClass”. And now probably you would have guessed. In the array “classes”, if the “SomeClass” comes as the first element you are screwed. The regular expression matches the “BlaSomeClassName_Bla” and the processing class is taken as “SomeClass”. Where as the right processing class is “BlaSomeClassName_Bla”.

This issue took quite a few days to really understand and get to the bottom of the code. Many many thanks to eclipse which enables a cool debugging. Conditional debugging is very useful in such scenarios where you would not want to wait for a long time to see the special case. Instead, introduce the right condition and rest is taken care by eclipse. This is what makes the eclipse my favorite IDE.

Do you have any such experiences with strings and regex ?

Posted in java, software | Tagged , , , | Leave a comment

Organizational Growth and Freeway Traffic

Did you every wonder any kind of correlation between the Organizational Growth and Freeway traffic ? As i travel a lot on the freeway over the weekends (to Southern California especially on the Route 1), i found an interesting correlation among these two.

Everyone of us would want to do great jobs and grow in an organization; Be it a small or big organization. Every once aspires and dreams to take some dream jobs and work towards it. Your success at work is mainly a function of yourself, organization, boss and job. How many times did you ever wonder that if i had a better boss, if i were in a  better project, if i was in “ABC” organization, etc… I see some of these scenarios and could not resist to compare it with the why we drive on the freeway.

Your Growth and Boss : For many of us Boss is the “Company” to you. As he is the person, everyone looks at a company. If he gives us a good feeling, you feel happy about the company and if he is bad, you are screwed. Boss is the one who recognizes the stuff in you, promotes you at the right time. Your growth pace is directly proportional to your Boss and his work. If Boss is sluggish and slow, so is your growth rate and opportunities. Many a times his speed is your speed (I often hear that many people leave the company because of the Boss and NOT because of the Organization).

Now compare this on a single line freeway with no turnarounds and no way to pull out of the road. Your Boss is the Vehicle in front of you. You are following the vehicle and your speed is DIRECTLY proportional it. If the vehicle in front of you is going fast you are going fast; if its slow you are slow. There is no way to bypass or move into another lane. You need to wait till he takes an EXIT and you are driving on your own. Does it ring the bell.

Corporates and Freeway : Many people that i know work in corporates so that they have the flexibility to move around the globe (with the companies multinational presence) and take on different areas of work (which could translate to different departments, business verticals and corporate divisions). When you typically work in such environments, if you do not like your boss or you want to move on…. you always have the OPPORTUNITY. Move to a new Division or Department or new Geo Area…. you are most probably set. You do not worry about being stuck to your SAME Boss for a long time.

Now look at the Freeway with multiple lines. You are driving in one lane and your vehicle in front of you gets clogged, move on to the other lane and drive ahead. You have many possibilities in terms of how you want to go and at what phase you want to go.

Of course it is the ultimate BAD LUCK, if ALL the lanes are busy and there is no way to escape :). The only thing you can do in this scenario is either to complete the travel or take an EXIT and move on to another freeway.

Oversight : We all want to do the dream job and in any organization there is a job that is most sought after. We all are in that QUEUE to get that job and achieve our goals. But we seldom see a job that is less sought after, BUT takes you to your destination much faster. We are so obsessed in doing our RIGHT job, we often forget that there is a less trodden path which would also take you to the destination.

Its easy on Freeway. We all want to go FAST, so we take the “LEFT” most lane. There are so many people who wants to drive faster, you see that the LEFT lane is full of vehicles and the other “SLOWER” lanes are almost empty. Even when we can move to the other lanes to avoid this big QUEUE, we don’t. It takes a little bit of insight and smartness to move from the LEFT lane to the other SLOWER lanes and reach the destination FASTER than the LEFT lane.

Dont you thing this happens with many us ? I will be glad to hear your experiences and such analogies.

Posted in management, technology | Tagged , , , , | Leave a comment

Eclipse Ganymede Release

Yesterday i have written a short blog;  Things i like in Ganymede. In my blog, Ganymede was misspelled which was purely unintentional. I would like to extend my sincere apologies to all the readers and Eclipse for the confusion.

Thanks to the readers who have timely pointed me this typo.

Posted in eclipse, java, plugins, software | Leave a comment

Things i like in Ganymede

Another great release from Eclipse this year with 23 simultaneous projects. I was little bit confused as to 23 vs 24 projects; these two numbers are hovering in different sources. Never the less, i am happy to download and play with the Release. Indeed, i was really happy and delighted to see my association with Eclipse – as a user and application developer, even though i would love to be a commiter – and the way we have been improving year-by-year.

Some of the very obvious features, i have been using from the day one.

Search Feature

Improvements in the Search feature are awesome. I specially like the detailed list of occurrences. Prior to 3.4 / Ganymede, i had to move quickly to the code segments that has the search keys. But now, with the detailed list view, i know exactly where i want to go.

Bread Crumbs in Java Editor

This was only available to some of the Web 2.0 style IDEs and Web sites. I am glad that we have this features with the JDT. Even though i have not checked, if i can re-use this Bread-Crumbs widget. At the development time, i really get a good view of the hierarchy. Remember that many of the developers would be editing the source files in the Full Screen Mode (Ctrl + M), if you need to edit or jump to another file, we often minimize, navigate and then again go back to the Full screen mode.With bread crumbs, this is so easy.

“dropins” folder

This is super cool. Prior to this release, i used to either manually/automatically copy the plugins and features into the eclipse directories or provide links to the 3rd party or custom plugins. With the “dropins” folder, its as simple as just DROPPING the custom or 3rd party plugins in the “dropins” folder. How cool is that.

New Projects and Working Sets

WorkingSets are very useful when working with multiple projects. Prior to 3.4, project can be added to a workingSet only after creating it. But with Ganymede , its possible to add a project to a working set at the time of creating it.

Enhanced Java Problem and Doc Hovers

When looking at the JavaDocs by hovering on some of the used or to be used APIs, i was tired of pressing F2 for a full view. Now Ganymede supports this EASILY by just moving the mouse over the Hovers. Quick fix also gives enhanced hover. This could prove to be useful some times.

Quick Assists

I personally feel this is a cool feature, as some of the refactoring features are combined in to the Quick Assists ( Ctrl+1 ). Instead of remembering the the Short Cuts, its easy to remember Quick Assist and luckily its context sensitive.

Read-Write Occurances

This is one feature that is small yet powerful. Once the source file is large enough, its difficult to know which methods are reading and writing a particular instance variable. This features ( Alt+Shift+O ) is very useful in this respect. It shows occurrences of reads and writes in different colors.

Arrange src elements from Outline View

This has been my long time wish to have this feature. Many times while coding, i have methods so randomly written that its time consuming to arrange them in the order (like all the Public, Protected, Private, Utility Methods, Class Helper Methods, etc…). This feature works like magic, just drag-and-drop the src elements in the outline view and the src code elements are automatically arranged.

Does anyone see that the BreadCrumbs View, Package View and Outline View are showing the elements in a different sorting order.

Debug Hover

During debug, the variable values are viewed either by Ctrl + Shift + I or with the context menu. With the Ganymede enhancement, the Mouse hover would show the variable values. This is real cool.

And Finally…….

Provisioning aka p2

The greatest thing that can happen to an Eclipse Developer and Eclipse User. For Non-Eclipse and Non-IDE users, it was difficult to chose the required plugins, their dependencies, nearest download site and then download and install. With the help of p2 this is made simple. Really SIMPLE. p2 would automatically detect the dependencies and the nearest site and then download it for you. You could also set the automatic updates for a particular plugin/feature.

I have not yet digged into all the features of p2, but i am sure there are ore features than i know.

Its so easy to browse the available software and then download it without worrying about the dependencies.

Automatic updates are possible from the Preference Page.

All in all, i am enjoying my time with Ganymede. I am sure that the ECF is one more exciting project that got released. But i have not got the time to play with it yet. I have seen one video that Ian shared. Its awesome.

Thanks to all those developers and the organizations behind them. Long live Eclipse.

Posted in eclipse, java, plugins | Tagged , , , | Leave a comment

Java XML Libraries – Quick Reference

Reader Level : Basic

Recently i have been involved in a project that uses heavy XML which game me opportunity to look into many Java and XML related technologies/libraries/parsers. I tried to share some of interesting libraries that i dealt with. Interestingly, i have seen very few developers knew what each term (like “Reader”, “Parser”, “Builder” and “Factories”) means in the XML world. The idea of this article is to introduce basic terms and some resources to start in depth dissection.

XML Parser Technology / Types :

Many refer to “XML parsers” as “XML APIs”. Whatever you call it, in the end every one wants to read, process and build xml in some way or the other. Though its quite possible to consider XML file as sequence of characters and write custom parsers, thats not the recommended way if one need to do their job in a “easy” manner. In the XML world we often fined two widely used parsers; SAX (Simple API for XML) and DOM (Document Object Model). I am limiting the discussion only to the SAX and DOM.

SAX : sax is a event-based parsing mechanism. As the “SAX Parser” parses the XML input streams, events like startDocument, endDocument, startElement, endElement, ect… are encountered and the client program gets the call backs. As this parser type does not load the xml document in to the memory, its relatively low on resources. Sax is a READ-ONLY api (i.e. One can not change any content of the XML File). Client is able to traverse the document in a sequential manner. The new SAX2 specification incorporates name spaces, filter chains, and querying. Some time they are also refered to as push-parsers, as parser pushes recognized tokens to the client.

DOM : DOM is a comprehensive API for XML documents. It lets clients to navigate, retrieve, add, modify or delete the contents from the source XML. As opposed to SAX, DOM stores the entire content of XML file in the memory. As one can imagine that storing the XML document would require some sort of object representation for Nodes, Elements, Attributes, ProcessignInstructions, Comments and Text types, its relatively heavy on the memory. The memory consumption size is normally viewed as 5x the XML size. DOM enables clients to access data randomly from the in-memory document. Before we go any further, its important to understand that the current discussion is limited to Java technology. So, lets see a little about the most-frequently-used package from the SDK.

JAXP :

The Java API for XML Processing (JAXP) enables applications to parse, transform, validate and query XML documents using an API that is independent of a particular XML processor implementation. JAXP provides a pluggability layer to enable vendors to provide their own implementations without introducing dependencies in application code. Using this software, application and tool developers can build fully-functional XML-enabled Java applications for e-commerce, application integration, and web publishing.

JAXP is a standard component in the Java platform. An implementation of the JAXP 1.3 is included in J2SE 5.0 and an implementation of JAXP 1.4 is in Java SE 6.0. JAXP 1.4 is a maintenance release of JAXP 1.3 with support for the Streaming API for XML (StAX). JAXP 1.3 contained five JAR files which were jaxp-api.jar, sax.jar, dom,jar, xercesImpl.jar, and xalan.jar. The packaging reflected the technologies covered, as well as sources used in JAXP 1.3. In JAXP 1.4, these technologies and the newly added StAX package have been tightly integrated into the JAXP RI

Parser Implementations :

Xerces-J : The Xerces Java Parser 1.4.4 supports the XML 1.0 recommendation and contains advanced parser functionality, such as support for the W3C’s XML Schema recommendation version 1.0, DOM Level 2 version 1.0, and SAX Version 2, in addition to supporting the industry-standard DOM Level 1 and SAX version 1 APIs. This release includes full support for the W3C XML Schema Recommendation, except for limitations as described on their website.

In order to take advantage of the fact that this parser is very often used in conjunction with other XML technologies, such as XSLT processors, which also rely on standard API’s like DOM and SAX, xerces.jar was split into two jarfiles:

  • xml-apis.jar contains the DOM level 3, SAX 2.0.2 and the JAXP 1.3 APIs;
  • xercesImpl.jar contains the implementation of these API’s as well as the XNI API.

XPath Implementations :

Jaxen : Jaxen is an open source XPath library written in Java. It is adaptable to many different object models, including DOM, XOM, dom4j, and JDOM. Is it also possible to write adapters that treat non-XML trees such as compiled Java byte code or Java beans as XML, thus enabling you to query these trees with XPath too.

Saxon : Saxon is a full featured library for the XSLT 2.0, XQuery 1.0, and XPath 2.0 Recommendations. Saxon comes in two packages: Saxon-B implements the “basic” conformance level for XSLT 2.0 and XQuery, while Saxon-SA is a schema-aware XSLT and XQuery processor. Both packages are available on both platforms (Java and .NET). Saxon-B is an open source product available from this site; Saxon-SA is a commercial product available from Saxonica Limited. A free 30-day evaluation license is available.

Xalan : Xalan-Java fully implements XSL Transformations (XSLT) Version 1.0 and the XML Path Language (XPath) Version 1.0. XSLT is the first part of the XSL stylesheet language for XML. It includes the XSL Transformation vocabulary and XPath, a language for addressing parts of XML documents. Implements Java API for XML Processing (JAXP) 1.3, and builds on SAX 2 and DOM level 3.Implements the XPath API in JAXP 1.3.May be configured to work with any XML parser, such as Xerces-Java, that implements JAXP 1.3.

Java XML Document Builders :

Do NOT confuse Builders with parsers. Builders basically uses the default/underlaying parsers, gets the org.w3c.Document and converts them to specific Document type (e.g. org.dom4j.Document or org.jdom.Document). DOM4J seems to be quite advanced in terms of the functionality for a Java developer. The JDOM API seems to be quite simple for the implementation.

JDOM : JDOM is, quite simply, a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing. It has a straightforward API, is a lightweight and fast, and is optimized for the Java programmer. It’s an alternative to DOM and SAX, although it integrates well with both DOM and SAX. Most importantly it uses Java Collection API. I hope its easy for a java programmer 🙂 .
As i understand JDOM relies on the Jaxen as the default XPath library. But we can also use any xpath lilbrary of our choice like xalan.

DOM4J : dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAXP.

References:

  • Xerces
    • http://xerces.apache.org/xerces2-j
    • http://xerces.apache.org/xerces2-j/faqs.html
  • JAXP
    • https://jaxp.dev.java.net
    • https://jaxp.dev.java.net/files/documents/913/16751/BoF-9209-Java-API-for-XML-Processing.pdf
  • JDOM
    • http://www.jdom.org
    • http://www.jdom.org/docs/faq.html
  • DOM4J
    • http://www.dom4j.org/cookbook.html
    • http://www.dom4j.org/compare.html
    • http://dom4j.org/benchmarks/xpath/index.html
  • Jaxen
    • http://jaxen.codehaus.org
    • http://jaxen.codehaus.org/faq.html
    • http://cafeconleche.org/books/xmljava/chapters/ch16s07.html
  • Saxon
    • http://www.saxonica.com
    • http://saxon.sourceforge.net
  • Xalan
    • http://xml.apache.org/xalan-j/overview.html
    • http://xml.apache.org/xalan-j/getstarted.html
  • A look at features and performance of XML document models in Java
    • http://www.ibm.com/developerworks/xml/library/x-injava/index.html
  • http://www.ibm.com/developerworks/edu/x-dw-xml-i.html
Posted in java, software | Tagged , , , , , , , , , | Leave a comment