Jan 20

TaDaList.com: One change to perfection ;)

Ruby, Tech, UI / UX, Web Frameworks 2 Comments »

I talked about the lovely clean, responsive, UI of tadalist.com.

There is ONE tweak that would make me happy as a bunny. At the moment you can subscribe to an RSS feed of your ToDos. At the moment the RSS pings you with new additions, which is nice, but isn’t what I want.

I would like the RSS feed to come at me with the following everytime a ToDo list has been changed (new item, item marked as ‘done’, etc).

RSS for Todo List: Code Changes for X

TODO:
- Add method foo() to Bar
- Refactor FileParser
- Scrap whole thing for Rails implementation

DONE:
- Add method bar() to Bar

This would be great as then when I am offline, I will always have my current Todo’s in my RSS aggregator. When a new RSS entry comes in for a ToDo list, I would just nuke my last one.

OR, if the same GUID was used, it would just be replaced!

Jan 19

TaDaList.com: Nice clean Rails app

Ajax, Ruby, Tech, UI / UX, Web Frameworks No Comments »

I found out about TaDaList.com from Jim Weirich:

I just came across this one today, and its the real reason I started this blog entry. Wow, what a simple idea. And so beautifully executed. Notice the lack of submit buttons. Just start typing todo list entries, hitting a return to go to the next one. Finished a todo item and want to check it off? Just check the box

Jan 19

rel=”nofollow” is a great idea

Tech, UI / UX No Comments »

I love the new rel=”nofollow” attribute that you can put into links now.

I am also amazed at how quick the attribute went from an idea to implemented in a lot of software!

The idea is that you can place a rel=”nofollow” attribute to a link. E.g. <a href=”http://to.some.site.com/foo” rel=”nofollow”>foo</a>

If a link has this attribute, the engines such as Google, Y!, MSN Search, etc know that the link isn’t ‘trusted’. This is particularly helpful in areas such as blogs when people can randomly write comments with URLs (unless they are stripped etc of course). No the blog software can always put in the new attribute and spammers won’t be able to bump their PageRank.

Although this is great to see, it would be nice to have a few more semantics (and have them defined in a small spec somewhere).

For example, maybe I want to say “I really like this site”, “I don’t really know about this site but don’t punish it”, “This site it totally untrusted”, etc.

I also don’t know about the value “nofollow”. How about “untrusted” or “trusted” or “super-duper-fan-baybee” :)

Jan 19

PostgreSQL 8.0

Open Source, Tech No Comments »

What a crazy day for announcements. AspectJ 5. JDO 2.0 voting. And now we get the 8.0 release of PostgreSQL.

PostgreSQL is a highly-scalable, SQL compliant, open source object-relational database management system. With more than 15 years of development history, it is quickly becoming the de facto database for enterprise level open source solutions.

What’s new in 8.0

  • Win32 Native Server
  • Savepoints
  • Point-In-Time Recovery
  • Tablespaces
  • Improved Buffer Management, CHECKPOINT, VACUUM
  • Change Column Types
  • New Perl Server-Side Language
  • Comma-separated-value (CSV) support in COPY

Download

Jan 19

Acegi Security Announces Version 0.7

AOP, Java, Lightweight Containers, Security, Tech No Comments »

A fair amount of Adigio projects have taken advantage of Acegi Security instead of container managed security. They just released version 0.7.

Dear Spring Community

I’m pleased to announce the Acegi Security System for Spring release 0.7.0 is now available from http://acegisecurity.sourceforge.net. The project provides comprehensive security services for The Spring Framework. You can read about the features in detail at http://acegisecurity.sourceforge.net.

There are many changes, improvements and fixes in release 0.7.0 (as listed at http://acegisecurity.sourceforge.net/changes-report.html). The major new feature areas are:

* Significant improvements to ACL security services
* AspectJ support (useful for instance-level security)
* Refactoring of ObjectDefinitionSources (especially useful for web URI
security)
* Automatic propagation of security identity via RMI and HttpInvoker
* Integration with Servlet Spec’s getRemoteUser()
* Refactoring of Contacts sample to use the new ACL security services
* Additional event publishing (now includes authorisation, not just
authentication)
* CVS restructure to use Maven as the build system
* A new project web site with FAQs, links to external articles etc

The new ACL security services deserve special mention, as they make it possible to develop applications that require complex instance-based security without any custom code. The entire configuration of such applications can be declared in the IoC container using standard Acegi Security services, so this should help significantly improve architecture and development time.

As per the Apache APR project versioning guidelines, this is a major release. We expect the next major release will be 1.0.0, although release 0.7.0 should be considered stable enough for most projects to use. There are detailed upgrade instructions included in the release ZIP and on the Acegi Security home page.

For Maven users, Acegi Security’s latest JARs are available from http://acegisecurity.sourceforge.net/maven/acegisecurity/jars. We will also be adding release 0.7.0 and above to iBiblio.

We hope you find this new release useful in your projects.

Best regards
Ben

Jan 19

Hibernate ImprovedNamingStrategy

Tech No Comments »

By default, a Hibernate class named FooBar will become a table named FooBar.

A lot of the time you don’t want this behaviour as:

  • You are mapping to existing schema which has different table names (e.g. foo_bar)
  • You have corporate standards
  • You just don’t like camel case for DB items

I have seen a lot of projects where the table name is manually added in:

@hibernate.class table="foo_bar"

...

@hibernate.property column="last_updated"

That is fine of course, but if you want to do it across the board you can nicely use the net.sf.hibernate.cfg.ImprovedNamingStrategy.

You need to set this up in Hibernates configuration. It isn’t a property (so you don’t just put it in the hibernate.properties file). Instead you need to have setNamingStrategy(…) called.

If you are using Spring to manage hibernate you can just do the following:

<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">

<property name="dataSource"><ref local="dataSource" /></property>

<!-- Must references all OR mapping files. -->
<property name="mappingDirectoryLocations">
<list>
<value>classpath:/homeabroad/model</value>
</list>
</property>

<!-- Set the various Hibernate properties. E.g. type of database; changing this one property will port this to Oracle, MS SQL etc. -->
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${jdbc.hibernate.dialect}</prop>
<prop key="hibernate.hbm2ddl.auto">${jdbc.hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.show_sql">${jdbc.hibernate.show_sql}</prop>
</props>
</property>

<property name="namingStrategy"><ref bean="namingStrategy"/></property>
</bean>

<bean id="namingStrategy" class="net.sf.hibernate.cfg.ImprovedNamingStrategy"/>

This is one naming strategy, which handles a simple CamelCase to camel_case conversion.

You can even write your own to do more complicated things. I saw a mapper like this on another ORM product which was even smart enough to do mappings such as making the tables plural. It even handled the case:

Person class to people table

Jan 19

AspectJ/AspectWerkz. JDO 2.0 Ballot Results. The good and the bad.

AOP, JDO, Java, ORM, Tech No Comments »

The top two posts on TheServerSide are:

  • AspectJ and AspectWerkz Merge Forces
  • JDO 2.0 Public Review Ballot

These give a glimpse at the good and the bad side of the Java community.

On the ‘good’ side we have the AOP news. Here we have two communities coming together for the greater good of the overall community. There isn’t the politics, nor the egos of “my app is better than yours”. They got together and talked about how they could work together and end up with a merger which is going to change AOP forever.

On the ‘bad’ side we have the JDO 2.0 ballot news. Here we have politics getting in the way. There are JDO users who are desperate to get JDO 2.0 implementations into their hands. They need it to take care of their business. Take a look at the vendors who went against the spec, and those who are for it.

I was optimistic, yet worried at the same time, about the EJB 3 / JDO 2 news that came out. It appears that some people are using that news as a way to hold back the JDO 2 spec. A lot of people have spent a LOT of time on that work, and our users deserve it right now.

P.s. I really liked Aslak’s quote regarding the AOP merger:

Forking seems to be more common than merging in the OSS world. This is great news. I wish you good luck.

Jan 19

AspectJ + AspectWerkz = AspectJ 5

AOP, Tech No Comments »

The announcement that the AspectJ and AspectWerkz team are merging is great. I think it is a serious win win for both projects, and more importantly… AOP in general.

I think the merger makes sense for both sides:

What AspectJ gets out of the merger

Top of the list is they get some really smart guys contributing to the new project. There is good work in the AspectWerkz weaver at load/runtime which can be used, and one of the biggest wins is political. There are a group of developers that don’t want to use AspectJ based on the syntax. The fact that it isn’t ‘just Java’. One of the great parts of the merger is that both front ends will be supported. Now developers will have the ability to use the AspectWerkz syntax if they prefer. This has just taken down another barrier to entry.

What AspectWerkz gets out of the merger

The AspectWerkz team has a great product. There are some pieces that they are missing and would like to have. For example, tools: Eclipse/IDEA Plugins, ajdoc, etc. The AspectJ team has several people dedicated to the tools. It is hard to expect Jonas and Alex to work on great tools as WELL as the platform itself. It also doesn’t really make sense for them to reinvent the wheel. Now they don’t have too. They will get to reuse the AspectJ tools, mature backend, and suddenly their development team has grown to include all of the great resources of the AspectJ group. This is a huge win.

The merger has been coming

If you have tracked both projects, you quickly see that the semantics have been getting closer and closer to eachother. Now, there are only a few differences between the core of both projects (semantically). As soon as you get to that point, it is obvious that it doesn’t make sense to compete as you are both so close. Team up and spend time furthering the cause instead of having two sets of tools. Two sets of backend.

The politics

The political side is also interesting. Who would have thought that BEA would be OK with having the project join Eclipse? There are reasons why it makes sense for the project to continue at Eclipse, and they revolve around patent law (remember, the Xerox patent is still out there!)

Read more: AspectJ and AspectWerkz to join forces

AspectJ and AspectWerkz Merge Forces

Jan 18

Container Managed Security: If your standard covers a lowest common denominator. Please add hooks!

Java, Security, Tech No Comments »

I understand that a lot of standards end up being lowest common denominators. That is one of the issues with design by commitee.

However, I wish that the standards would have defined hooks that allow you to write code which uses the standard but adds on functionality.

Take the Servlet API for an example. This is one of the better APIs in J2EE. It is pretty darn portable. I try really hard to be able to have a .war that can be placed in a container and have it just run, but this isn’t always the case. If I have to open up a server.xml I think I failed :)

One example is Container Managed Security. Their are a couple of features that I really wish were in the spec. How about the ability to LOG OUT (not just nuking the session!). What about enhancing the security piece?

Take a login box. Form-based security allows you to setup a username and password and get authentication/authorization going. However, what if you want to do something like a ‘Remember me?’ check box, or the security image that I talked about last week.

Since the spec doesn’t have any hooks, and doesn’t easily allow a filter to kick in before the security piece, this becomes really tough. Well, on some servlet containers. Remember Me? functionality is built into Resin. I don’t have to do a thing. But, unless I know that I want to only run on Resin, I am kinda stuck.

I said before that I wanted to be able to create a .war file that runs in any container. To do this now I use another system for handling security. Trying to get around the CMS system is more trouble than it is worth. Is there a nice programatic API to log someone in and out? No.

For this reason I end up using something like Acegi Security for Spring.

Come on guys, give me some hooks!

And, let’s not get started on JAAS and how there isn’t a standard API to create users/groups in the system! Argh!

Jan 18

Arrays.asList(”Rod”, “Jane”, “Freddy”);

Tech 2 Comments »

I think that the Arrays.* methods are not that well known among Java developers.

I still mainly see people write:

List<String> list = new ArrayList<String>();

list.add(”Rod”);
list.add(”Jane”);
list.add(”Freddy”);

instead of the asList method that was put into JDK 1.4:

List<String> list = Arrays.asList<String>(”Rod”,