Showing posts with label My Applications. Show all posts
Showing posts with label My Applications. Show all posts

Saturday, March 12, 2011

Unobtrusive jQuery UI (jquery.ui.unobtrusive)

I am very enthusiastic about unobtrusive JavaScript. It's a design pattern and usual warnings apply:
  • It doesn't apply to every scenario.
  • It will hurt if you use it wrong.
  • Long etc.
Very short version of this post

I hope someone creates a complete jquery.ui.unobtrusive plugin. Since I'm a developer I have already started one at:
https://bitbucket.org/rodolfograve/jquery.ui.unobtrusive

The bad news is that I'm not an expert JavaScript nor jQuery developer, so I'm sure the quality of what I'm doing can be greatly improved. It will be great if someone with more expertise could continue this work or start his own and make it public.

Long version

I think unobtrusive JavaScript solves several old and current problems:

  • How do we make advanced HTML + JavaScript stuff from server-side code?
  • How do we reuse JavaScript code that interacts with the elements of a page?

Until now I've seen incomplete and ugly approaches (the latter is obviously a personal opinion):
  • Don't do advanced HTML + JavaScript from server-side code at all and create custom JavaScript code for each page you have.
  • Generate small pieces of script from server-side code, intermingled with the final HTML code (outside the head tag), and handle elements' IDs and classes.
With unobtrusive JavaScript we have a new great approach: generate HTML attributes in your tags and let your unobtrusive scripts do their science (I appreciate science more than magic).

This new approach is:
  • Flexible: you can use whatever you like to generate the attributes (ASP.NET MVC HtmlHelpers, your own framework, write attributes by hand in your HTML, etc).
  • Testable: unobtrusive scripts can (or even must) be developed as reusable components, with their own tests (JavaScript as a Framework).
  • Readable: your HTML code will declaratively express what it does (no need to look IDs nor classes in JavaScript files).
No more obscure separation between the appearance and the behavior. This separation is good and encouraged, but it's much better without the "obscure" feature added by current implementations (you must look your IDs or CSS classes in your JavaScript code to know what's going on with an HTML element).

<html>
  <head>
<script type="text/javascript">
  $(document).ready(function() {
    $("myDatePicker").datepicker({
      showOn: "button",
      buttonImage: "../themes/mytheme/calendar.gif"
    });
  });Notice this piece of script usually is in another file (even worst).
</script>
  </head>
  
  Lots of stuff, and then hidden some where in the page:

  <input id="myDatePicker" name="myDatePicker" type="text" >

With unobtrusive JavaScript you keep the separation at the implementation level, and avoid the separation at the code level.

<input type="text" ui-datepicker="true" ui-datepicker-showOn="button"
                                             ui-datepicker-buttonImage="../themes/mytheme/calendar.gif" >

This last code looks much better to me and I wish we soon have the unobtrusive "mapper" of the most popular JavaScript frameworks out there.

What do you think?

Saturday, July 17, 2010

Another award for TEAM's TimeTracker

This has happened many times in the last few months, but every time is important:

TEAM's TimeTracker has been awarded the "Famous Software Award" by "Download.FamousWhy.com":
TEAM's TimeTracker

These later awards have inspired me to spend some time on my old applications trying to make them better, and I have recently released version 2.4.0 of TEAM's TimeTracker and version 0.2.0 of TEAM's Db4o Management Studio.

I'd like to ask everyone who is using or have used these application to leave their comments and suggestions at bitbucket.org:

Monday, September 21, 2009

TEAM's Db4o Management Studio v0.1.0 is out

Many times in the latest couple of months I've found my self hoping for a tool that would allow me to inspect a db4o database without using the classes that were used to save the data.

One of these situations is when I'm migrating an old classes' schema into a new one, and I really need to see what's inside the database to implement the migration.

After so much hoping and dissapointment on the Db4o Object Manager, I decided to implement a simple tool to do the job. The result is a very simple (and crude) application.

Don't expect anything fancy, but please, send any comments and suggestions, and feel free to copy the idea and make a better tool. The db4o community will thank you.

You can get the application from sourceforge here

Thursday, August 27, 2009

TEAM's TimeTracker v2.2.0 is out

A long time ago I built an application to manage the time me and my co-workers spent at work. I built the tool to be very simplistic and useful.

Although I published it in SourceForge since the beginning, I didn't have notice of any other users of the application until recently, on July 15th 2009, when Softpedia included the application in their database:



From that moment on some people started using it and it became obvious that the errors which we were already used to were a blocking issue for most people out there. That's why I've spent some time fixing those errors (and hopefully not introducing new ones).

Thanks to Randy Schultz for reporting most of the issues, and thanks to my former co-workers in Expectra for using the application no matter what, the TEAM's TimeTracker v2.2.0 is available at SourceForge:

http://sourceforge.net/projects/wpf-timetracker/

This version is able to automatically migrate the old data you had if you were using v0.1.0.

I hope you like it.

Wednesday, July 15, 2009

TEAM's TimeTracker es realmente público ahora

Hoy he recibido una sorpresa: TEAM's TimeTracker pasa a formar parte de la base de software de Softpedia.

Siempre pensé que la aplicación era útil, sin duda lo ha sido para mi y para los Expectros que la utilizan a diario, pero tampoco hay dudas de que tiene demasiados errores.

Creo que esta noticia hará que le dedique un tiempo a pulirla un poco.