Friday, August 29, 2008
Newbie to REST
How to explain REST to my wife
http://tomayko.com/writings/rest-to-my-wife
Wednesday, August 13, 2008
Essential Skill for Agile Developmet (Turning Comments into Code)
Today im reading the following chapter 2: "Turning Comments into Code".
How often we find outdated comments in the code, how often do we find useless comments in the code.
Basically this chapter tells you that if would be better insteads of putting a comments side by side with the code, just to make the code as clear as the comments itself. i.e:
public class ParticipantInfoOnBadge {
String pid; //participant ID
String engName; //participant's full name in English
String chiName; //participant's full name in Chinese
String engOrgName; //name of the participant's organization in English
String chiOrgName; //name of the participant's organization in Chinese
String engCountry; //the organization's country in English
String chiCountry; //the organization's country in Chinese
...
}
this could be written like:
public class ParticipantInfoOnBadge {
String participantId;
String participantEngFullName;
String participantChiFullName;
String engOrgName;
String chiOrgName;
String engOrgCountry;
String chiOrgCountry;
}
As you can see the code itself is clear enough to understand the meaning on each fields, even thought i could place a lot of examples showing where comments are not worth, i would rather prefer you to read the book.
Let me cite a paragraph from the chapter that clearly shows what the author is trying to teach us:
Why delete the separate comments?
In fact, comments by themselves are not bad. The problem is that we often
do not write clear code (because it is hard), so we take a shortcut
(use comments) to hide the problem. The result is, nobody will try to make
the code clearer.
Later, as the code is updated, commonly nobody updates the comments
accordingly. In time, opposed to making the code easier to read,
these outdated comments will actually mislead the readers. At the end of
the day, what we have is: Some code that is unclear by itself, mixed with
some incorrect comments.
Monday, July 7, 2008
Tuesday, June 17, 2008
Design Pattern and UML Quick Reference
http://www.mcdonaldland.info/2007/11/28/40/
Or Just get the PDF by clicking:
http://www.mcdonaldland.info/files/designpatterns/designpatternscard.pdf
Also for those who want to have a quick guide for UML:
http://www.mcdonaldland.info/2008/06/16/design-patterns-refcard-released-today/
http://www.digilife.be/quickreferences/QRC/UML%20Quick%20Reference%20Card.pdf
Monday, June 9, 2008
Organizing your Mp3 Files - MediaMonkey is your tools
I was goggling for a way to re-organizes my files to have the correct "file-name" based on the ID3 tag, i can do it manually file by file, but it will be a pain.
Then i found this EXCELLENT Free software, MediaMonkey
I must agree it has a funny name, but damn that tool rocks!!!!
The auto-organizes feature and auto-tag from web really helps to organizes your music, so you can browse your Music Collection easily. Even when the file is is not properly tag, it allows you to easily search on the web and then select the correct one.
Thursday, June 5, 2008
Wednesday, June 4, 2008
Wicket Resources Links
This time, im talking about Wicket Framework resources (I wont say again, how great Wicket is). but this post is just for a setting a reminder point where to find right information and good examples in a well organized places for this great framework. Hopefully, i'll keep adding other's resources on this post. So anyone on the net can find them easier than i did :)
For my friends (Yes, i know i'm a "MALETA" when talking about searching criterias).
For those non-spanish reader ("MALETA", gets translate as "SUITCASE", but we aren't talking about travels here :P) in DR (Dominican Republic) we use this term as of referring to someone with bad skill for something in particular in a very non-offensive and joking way.
General
http://cwiki.apache.org/WICKET
Wicket Best practices and Gotcha
http://cwiki.apache.org/WICKET/best-practices-and-gotchas.html
Great Reference Library
http://cwiki.apache.org/WICKET/reference-library.html
How to do things in wicket
http://cwiki.apache.org/WICKET/how-to-do-things-in-wicket.html
Wicket Examples
http://www.wicket-library.com/wicket-examples/
I'll keep adding more link on demands. Happy Wicket!
A quick look at "Inversion of Control and Dependency Injection Pattern"
Here is a preview of the article :) Enjoy it!
"In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of "Inversion of Control". In this article I dig into how this pattern works, under the more specific name of "Dependency Injection", and contrast it with the Service Locator alternative. The choice between them is less important than the principle of separating configuration from use."
One of the entertaining things about the enterprise Java world is the huge amount of activity in building alternatives to the mainstream J2EE technologies, much of it happening in open source. A lot of this is a reaction to the heavyweight complexity in the mainstream J2EE world, but much of it is also exploring alternatives and coming up with creative ideas. A common issue to deal with is how to wire together different elements: how do you fit together this web controller architecture with that database interface backing when they were built by different teams with little knowledge of each other.A number of frameworks have taken a stab at this problem, and several are branching out to provide a general capability to assemble components from different layers. These are often referred to as lightweight containers, examples include PicoContainer, and Spring.
Underlying these containers are a number of interesting design principles, things that go beyond both these specific containers and indeed the Java platform. Here I want to start exploring some of these principles. The examples I use are in Java, but like most of my writing the principles are equally applicable to other OO environments, particularly .NET.
Components and Services
The topic of wiring elements together drags me almost immediately into the knotty terminology problems that surround the terms service and component. You find long and contradictory articles on the definition of these things with ease. For my purposes here are my current uses of these overloaded terms.
I use component to mean a glob of software that's intended to be used, without change, by application that is out of the control of the writers of the component. By 'without change' I mean that the using application doesn't change the source code of the components, although they may alter the component's behavior by extending it in ways allowed by the component writers.
A service is similar to a component in that it's used by foreign applications. The main difference is that I expect a component to be used locally (think jar file, assembly, dll, or a source import). A service will be used remotely through some remote interface, either synchronous or asynchronous (eg web service, messaging system, RPC, or socket.)
I mostly use service in this article, but much of the same logic can be applied to local components too. Indeed often you need some kind of local component framework to easily access a remote service. But writing "component or service" is tiring to read and write, and services are much more fashionable at the moment.
Read the whole article at MartinFowler.com
Tuesday, May 27, 2008
Elaborates Reports with EXCEL
EXCEL is the favorite tool for a common user on its daily basic work. For me and for most the people i know, EXCEL if the best software packaged in the MS-Office Suite.
How ever finding a library that suite your needs it kinda difficult sometime.
Currently exist Apache POI, this library intends to be the bridge between all MS-Office package and the Java World, currently its on a very early stage and most of the work its being done on the EXCEL implementation API. This library give you the complete control over the documents and sheets, w
hich i found it interesting when you want to build your report from scratch.
But in the other hand, the JXLS Project which only focus on EXCEL Interoperability, seems for me the right choice when you have a very elaborate template with a fancy design and just want a way to inject data directly into it.
Check the following example and you will know what i mean.
Wednesday, May 14, 2008
Are u a Good Programmer or Not, how to find it out
Let me list you the "Criteria Bullets" you can use to identify if a Programmer you know, it may be good or bad :-)
Here you can find the whole article with a detail explanation on each point, please enjoy it :)
http://www.inter-sections.net/2007/11/13/how-to-recognise-a-good-programmer/
The criteria in bullets
So, in summary, here are some indicators and counter-indicators that should help you recognize a good programmer.
Positive indicators:
- Passionate about technology
- Programs as a hobby
- Will talk your ear off on a technical subject if encouraged
- Significant (and often numerous) personal side-projects over the years
- Learns new technologies on his/her own
- Opinionated about which technologies are better for various usages
- Very uncomfortable about the idea of working with a technology he doesn’t believe to be “right”
- Clearly smart, can have great conversations on a variety of topics
- Started programming long before university/work
- Has some hidden “icebergs”, large personal projects under the CV radar
- Knowledge of a large variety of unrelated technologies (may not be on CV)
Negative indicators:
- Programming is a day job
- Don’t really want to “talk shop”, even when encouraged to
- Learns new technologies in company-sponsored courses
- Happy to work with whatever technology you’ve picked, “all technologies are good”
- Doesn’t seem too smart
- Started programming at university
- All programming experience is on the CV
- Focused mainly on one or two technology stacks (e.g. everything to do with developing a java application), with no experience outside of it
Friday, May 2, 2008
RIA Development - Choosing the right tools
Even that RIA is not a new term for me, I start wondering myself how would be a full Ajax-Enabled application with no servlets, no JSF, not any framework that tie me up to a Preprocessing Life Cycle for generating dynamic content into my pages.
I know HTML, I know JavaScript (at least that what I think :-] ) , and I know Java, how can I mix this up and build a Web 2.0 Application with zero Page processing (JSF, JSP, Servlets, SpringMVC, Struts, Wicket),because all of them required you to build your JSP/HTML with some kind of markup in order to get processed in the server.
The answer is just at the next corner: DOJO + DWR
DOJO with its incredible set of JavaScript Widget, DOM manipulator utilities and great look and feel, makes you take it seriously as the right tool for developing RICH UI with just HTML and JavaScript.
Check the "Why Dojo"? .
Check the next example as well.
What’s great from DOJO is that you have a lot of JavaScript power for the price of "24K" (Relax, 'K' stands for Kilobytes not Money :-] )
Now in the other hand with DWR:
Which turns to be my Counterpart for the Server Side Processing, since DWR can automatically Marshall and UnMarshall Java Object into JavaScript Object make it perfect as my Transport and Processing Layer between the Client and the Server.
This mean I can have my plain Java Class with access to my set of Hibernate DAO and have communication back and forth without need to write a Servlet or any Special Class that will be managed by the Container.
And since with DWR I can have access to the Http Session Object via the WebContextFactory I can managed the State between my JavaScript AJAX calls. :), for me that something cool.
Think about it, I believe this two technologies can work pretty well if you're a trying to build the Next Web2.0 Application for your Customer. Give them a try and let me know your thoughts.
Thursday, March 27, 2008
When a boolean answer is not enought
ExternalSystem -> isDuableOperation( param)
-> Literal Formal Answer: "YES" | "NO"
At first i just thought why didn't return a boolean, nah never mind and i built all my API's around the following assumption
[java code]
public static boolean isDuableOperation(String param){
String output;
// Code that invoke the ExternalSystem;
return "YES".equals(output);
}
it seems simple and works perfectly fine, however few weeks later i got a call saying the UI-Flow was stop none of the inputs were validated correctly.
After digging in the logs the following was found:
[Log file simulation]
dd-mm-yyyy: INFO: com.xyz.ExternalSystemGateway-isDuableOperation -> "The variable ouput is 'ERROR' "
I was shocked, and reminds me WTF web site, then i said myself WTF with the guy who designed the interfaces and how the output should looks like, "YES/NO/ERROR". The most interesting part of this is that when i called the ExternalSystem Support even they were clueless...... :-S
Wednesday, March 12, 2008
Wicket, a web framework that provides real Event Driven Programming
Frameworks, Frameworks Everywhere
| Echo | Cocoon | Millstone | OXF |
| Struts | SOFIA | Tapestry | WebWork |
| RIFE | Spring MVC | Canyamo | Maverick |
| JPublish | JATO | Folium | Jucas |
| Verge | Niggle | Bishop | Barracuda |
| Action Framework | Shocks | TeaServlet | wingS |
| Expresso | Bento | jStatemachine | jZonic |
| OpenEmcee | Turbine | Scope | Warfare |
| JWAA | Jaffa | Jacquard | Macaw |
| Smile | MyFaces | Chiba | JBanana |
| Jeenius | JWarp | Genie | Melati |
| Dovetail | Cameleon | JFormular | Xoplon |
| Japple | Helma | Dinamica | WebOnSwing |
| Nacho | Cassandra | Baritus | Stripes |
| Click | GWT | | |
Looking for a framework that provides a way to represent a true Event Driven Model, instead of the common MVC Front Controller J2EE pattern and truly believe i hit on the right nail.
I grabbed most of the content from an article posted on javageek.com on 2006 and from Wicket Introduction pages, to gives you a brief of how amazing this framework can be for Web Development.
WICKET
So, what is Wicket? This is the description from the main site:
Wicket is a Java web application framework that takes simplicity, separation of concerns and ease of development to a whole new level. Wicket pages can be mocked up, previewed and later revised using standard WYSIWYG HTML design tools. Dynamic content processing and form handling is all handled in Java code using a first-class component model backed by POJO data beans that can easily be persisted using your favourite technology.
Component state
Non Intrusive for your HTML Designers
Simplicity
Hopefully you will grasp the idea behind Wicket Framework and start playing around with it to understand how it truly works.
Tuesday, March 11, 2008
Are you still thinking what Java Web framework do you need to learn..
Saturday, March 1, 2008
Keeping Spammers away from gmail
Many popular sites started using the CAPTCHA methodology to avoid automatic registrations via BOTS since year 2000. Sites like hotmail, yahoo, gmail and others are using this method to avoid 'automatic account creation'.
CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) developed by the Carnagie Mellon University, was broken a weeks ago. It just matter of time to start seeing spammers with Gmail account and other sites being violated.
If you have a site that use this method to keep BOTS, outside your site. Be aware that CAPTCHA is not longer safe.
Since, CAPTCHA was developed by Carnagie Mellon University. Can we expect some solution by Google?. Lets think about that for a minute Google has always overpass everyone expectation with many contributions and probably they had already started some internal research on this. (This is just my assumption, i haven't heard anything official yet).
Lets wait and see what happens. :D
Saturday, February 16, 2008
Spring Overtakes EJB
http://www.infoq.com/news/2008/02/ejb-spring-job-listings-trends
Monday, February 4, 2008
Managing Eclipse Plugins Installations
How it manages its plugins is quite amazing, just decompressed the package inside its corresponding "eclipse/plugins or eclipse/features" directory and restarting the IDE will be enough for having the plugin already installed in your workspace.
But I must say that such great architecture has a huge disadvantage, since inside those directories are tons of predefine plugins which are available with the default eclipse installation, it's become hard to keep track of all you post-installation plugins and it gets worse when you make an IDE upgrade i.e. (from Eclipse 3.1 to Eclipse 3.2) you get on the need to install all those cool plugins you downloaded for your development environment once again or imagine you want to upgrade an existing plugin manually, that can be really troublesome!
Digging on the Internet, found an interesting article posted by IBM on 2003 called: Put Eclipse features to work for you.
Where one on its topic it how to organize all your plugins outside the "Eclipse" installation directory, arrange them in a non-intrusive way so you can upgrade them or remove them easily.
Lets focus on that topic:
First use a clean copy of Eclipse with no other installed plugin, you can choose the flavor you want from the Eclipse Download Center and place it on "C:\eclipse" or "~/home/eclipse" or "/opt/eclipse" where ever you want on you Disk architecture :D
Let’s assume it’s installed on "C:\eclipse" for the simplicity of the example.
Now, lets prepare our plugins repositories:
In any place of your hard drive create the following directories which will hold your plugins structure, in my case I have: "D:\javarelated\eclipseplugins\jbostool\eclipse", for this example I’ m installing the new set of JBOSSTool plugins for my Eclipse 3.3, after doing this uncompressed all you plugins there, since each plugins knows where it must be installed (plugins or features directory) you will end with the following structure:
"D:\javarelated\eclipseplugins\jbostool\eclipse\plugins"
"D:\javarelated\eclipseplugins\jbostool\eclipse\features"
Ok, guys we are almost done, lets now link them together (The fresh Eclipse Installation and you newly plugins repository", move to your eclipse installation directory and create a new directory name it as "links" i.e.: "C:\eclipse\links" and using your favorite Text editor create a file with the name you like but it must have the ".link" suffix, on this example I created: "jbosstool.link" containing the following line:
path=D:\\javarelated\\eclipseplugins\\jbostool
Please watch the double “\” here.
And we are done, make sure you restart you eclipse with the -clean argument to get any new plugins loaded and have happy coding.
Friday, February 1, 2008
Some Funniest video i have seen, starring: "I will Survive"
Life is only one, Enjoy it!
I can remember that day when I got the news that I was going to be dad (Almost got a heart attack :D ), for sure can also remember how I felt when she was born, and when I was at the Hospital afraid of taking her on my arms because I thought that I was going to drop her or hurt her tiny body because of my inexperience on this area :)
But now she is 5 years old of pure energy and love; she is so cute that she can make the toughest person to get melt.
I still can remember her first photographic session that we have together at place called: "El Jardin Botanico" she was 1 year old. Please Guys/Ladies listen to me, share with your kids a "photographic session" not a "formal" session with a tuxedo or an elegant dress, just a "session" where you can play with them and get caught by the lens of a camera, believe me you wont regret it. :)
The point that I' m trying to make here is simple:
If you lost some money, you can get it back.
If you lost your Job, you can get a new Job back.
....
But the time you lost, it’s time you won’t get back no matter how much you try it.
The time is passing faster than when were kids and it’s up to us not wasting our time, in things that will not bring you nothing to your life.
So manage your time correctly, and you will never regret it.
PS:
Please i don't want to make you have the impression i' m an OLD Man sitting in a couch, just telling stories of my life.
Its just i' m realistic, that we are getting older and need to be focus on important things.
Wednesday, January 30, 2008
First Post
I don't know if i can keep the track of those greats Blogs out there, but i 'll try my best and just the time will judged me if i did it right or not.
With this first entry i hope to start my journey as a common writer while expanding my vocabulary, share my thoughts and anything that comes into my mind with you.
