Skip to main content

Posts

Showing posts from August, 2009

RIA technologies: lets compare font rendering.

The idea is to compare the current RIA frameworks like Flex(Flash), Silverlight and JavaFX and see what are the fonts that they produces. We are in 21th century most of the people have laptops and use TFT screens and windows is the most usedOS this days, so most of the people use clear type font rendering. Lets see how each technology uses clear type : For me the best fonts with clear type enabled are fonts in WinForms and native windows applications. I’ve found very interesting comparison here: http://www.scottlogic.co.uk/blog/wpf/2009/07/silverlight-v3-cleartype-font-rendering-a-comparison/ I will use some of the screenshots from there. WinForms (ClearType OFF) You can see that WinForms with ClearType off are still best for CRT screens but not good for TFT screens. WinForms (ClearType On) The WinForms + ClearType is the best from microsoft for now. ...

RichFaces server-side paging with DataTable.

Most of the component toolkits have build in support for server-side paging this days but in rest of the cases you need to customize a little the data model or data provider or component itself to have data paging. The reason why I write this post is because when I first saw richfaces everythink was perfect except the server-side paging. They have paging but it was client side based on JavaScript witch just doesn't work in many cases and I loose a lot of time to understand all models, which model I must extend and how to do it to create a data model with server side paging. At the current version of RichFaces on the demo page information about how to do server-side paging at least exist http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=dataModel&cid=3608154 but like always the JBoss/RedHat/Exadel doesn’t provide us a fast full easy working example and we must loose a lot of time to search for classes in the demo. The reason why I write this post is to giv...

Hibernate Generic DAO.

When you use Hibernate and DAO pattern it is a good idea to use a Generic Base Dao. The fallowing code snippet contains GenericDAO that is a base class for all my DAO classes. This GenericDAO uses HibernateDaoSupport from Spring for its implementation if you want you can use JpaDaoSupport or JdbcDaoSupport in your projects. My Generic DAO interface looks like this : package org.joke.myproject.dao.base; import java.io.Serializable; import java.util.List; /** * @author Naiden Gochev * @param <E> * @param <PK> */ public interface GenericDao<E,PK  extends Serializable> {     PK save(E newInstance);     void update(E transientObject);     void saveOrUpdate(E transientObject);     void delete(E persistentObject);     E findById(PK id);     List<E> findAll();     List<E> f...