Solution to the Grails problem when a domain class claims to have an abstract class as an effective class (i.e using getClass() and domainClass.class returns an abstract class) by removing the Hibernate proxy of that certain instance
And with that huge title :-D , I want to talk about a little technique that I like to use in Groovy by taking advantage of the method parameters with default values feature. By method configuration and method body I am refering to two typical parts of a business logic method (for example, a method […]
En Java a veces es necesario cambiar el valor de un atributo privado de un objeto. Por suerte, la reflexión nos permite hace esto de forma sencilla. El código, como vereis, no puede ser más simple: public static void setField (Object o, String fieldName, Object newValue) throws IllegalArgumentException, IllegalAccessException { // Get all the object […]
Hace no mucho Jose y yo hemos terminado una práctica muy interesante. Se trata de programar una librería para manejar un brazo industrial “de juguete” (por tamaño, más que nada), y posteriormente usar esa librería para hacer una demostración (el brazo robótico resuelve el juego de las torres de Hanoi para 3 discos. La librería […]