Tuesday, July 08, 2008

Blend

During my school days, I was very much interesting in drawing and painting. For most of the time, I used to engage myself into drawings. The drawings were nice, but I was not very much happy to see them after I applied paint. I had never tried blending the colors and using them, which was the reason why the drawings looked ugly. After realising the problem, I started blending the colors and using them. The drawings started looking nice and richer. I just had to make sure I had picked proper colours to blend.
A similar notion is seen and practiced in sofware , named - "polyglot programming". Neal Ford has nicely explained the idea. According to him - we are beginning to see a time where even the core language (the one that gets translated to byte code) will cease its monoculture. Applications of the future will take advantage of the polyglot nature of the language world. There exists a number of languages that are target to Java and .Net platforms. Why not to blend these languages and come up with richer and colorful software. The times of writing an application in a single general purpose language is over.
The same concept of blending things up, to get a rich experience can be taken to another level, where we can blend together practices and tools. Rich practices like TDD and tools like Mylene can be used together to get a rich programming experience. A normal TDD cycle is - Write tests, the test fails, write some code and get the tests green, refactor the code. Getting deeper into the notion of TDD, reveals that we are moving closer to the problem domain. With every TDD cycle of red and green bars, the domain knowledge grows, and eventually the code talks more about the domain. Mylyn speaks somewhat similar - Focusing on the task and monitoring the work actively to identify information relevant to the task-at-hand/ problem domain. So mylyn help us in remaining focused on a particular task by reducing the information overhead and TDD helps us to gain more and more knowledge about the task and increasing the confidence.
Just to add, I believe that along with the blend of languages, the use of right tools at the right time would help us in getting a richer programming experience.
I am a newbie in TDD, so far it has been a great experience blending my tests with mylyn tasks. In the next barcamp I would be speaking on usage of mylyn while programming that will make development a richer experience.
stay tuned...

Monday, May 12, 2008

Eclipse installed on my Bike


So now I have Eclipse installed on my Bike and I can have Eclipse assisting me where ever I go - from office to home and all aroung Pune. :)

Enjoy Riding...

Sunday, April 06, 2008

EMF and GEF presentations



Thursday, January 24, 2008

First steps with GMF

One of my first achievements in GMF was creating an editor for editing model with nested containment relation. It is interesting to see how quickly an editor evolves; especially if you are from GEF background. Other than the fancy code generation stuff, the important aspect of this fine framework is that it allows you concentrate on your domain. You really don't have to bother about writing the Editor classes,or the EditParts or the command. Most of the code gets generated, and we just have to write the remaining domain specific part. The downside is that you are unaware of the stuff that goes behind Editor generation. Well, that may not happen if you have been a using GEF.
Let's see how easily an editor for editing nested containment relation can be generated.
1. Basically the model should hold nested containment relation between objects. Lets say a relation between a package and a class. Multiple classes can be dropped in a package.
2. A compartment need to be added in the graphical def. mode(.gmfgraph). The graphical def. model is the place where the graphical properties of the object can be changed.
3. In mapping def. model, the object to be contained, gets modeled as a reference relation, which is not expected. So we need to make some changes.
a. Add a child reference to the Container.
b. Add a node mapping to the child reference, and then add a feature label mapping.
c. Add a compartment.
d. Setting the required properties of the above generated nodes.
e. Make sure to validate the model before moving ahead.



Figure shows an editor with nested objects. The Employee and the Department are contained in the Organization. Well, thats it for this post. I have already started debugging GMF project and coming posts will be more specific to the architecture, the implementation of GMF and the implementation differences in GMF and GEF.

Happy debugging.

Sunday, December 09, 2007

Build Successful!

Its 12:56 AM and I am still in office, trying to get the build process for my project automated and after struggling for a long time, finally a message popped on my command prompt - Build Successful !. Wow what a relief.
Getting the build automated was a challenging task and it was another good learning experience. The best part was understanding the insights of Eclipse PDE build and ANT(I call it a smart tool).
Thanks to Ketan and Ravi who help me thought this process.
So this was another learning experience for me. I discovered some really cool things and also some of my shortcomings. I hope to encounter such problems and keep learning, and keep improving.

Stay hungry, Stay foolish...

Wednesday, October 24, 2007

Fluent interface

A truly fluent interface can be a delight to use. Anything which reduces the amount of stuff I have to remember about how a class is implemented when I’m reading code that makes use of that class is definitely a good thing. Using a fluent interface can be akin to programming in a well thought out Domain Specific Language.

http://www.bofh.org.uk/articles/2005/12/21/fluent-interfaces

Saturday, September 22, 2007

Fortunately my project contains bugs

I have been working with bugs since last 4 months and I believe its kind of interesting stuff. Sometimes they really get on your nerves but most of the time they teach you something new and interesting.
Few days back I was trying to fix a bug which was something like – If I rename an object in the tree viewer, the model was not getting updated and thus the object/diagram on the view area was not getting updated. Now this seems simple, but it had some interesting problems hidden beneath.
1. The Model behind the treeViewer and the view area was not same. They both had separate models which was wrong. They were supposed to have the same model.
2. In the tree viewer I just had the new name and the old name. I didn’t have exact model that needed to be updated.
3. The model was in another plug-in and somehow I got cyclic dependency when I tried to add the model plug-in dependency in the view plug-in.
4. The interesting part was - I had the serialized resource that I could load
So for the first 1 day I was just scratching my head and debugging, hoping to find something sensible. Then I realized that I had the model in the serialized form. Now how am I going to desterilize. So I learned how I could use the “Resource api” in eclipse and serialize and desterilize the model. Now I was in a good position since I had the model.
Now I was expecting that I just need to set the name on the model, it will send out notifications and the EditPart will be triggered and it will update the view. WOW. I was a happy man. But my view was not getting updated even if my model was updated.
So I started debugging. After a while I realized my model did send out notifications
but my EditPart was not activated. So again I was left scratching my head and debugging. Now I realized that the resource set that I got was not the one that was needed, but I had to get the in memory resource set.
Then my friend Ravi helped me to figure out the inmemory resource set. It was just inside my Viewer.That was it.
So the bug fixing journey was and will always be interesting and I hope to encounter similar bugs and hope to learn new things.