<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog4Java &#187; Programming</title>
	<atom:link href="http://malsolo.com/blog4java/?cat=3&#038;feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://malsolo.com/blog4java</link>
	<description>A personal and Java blog, likely only for me</description>
	<lastBuildDate>Tue, 31 Mar 2015 15:52:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Orika time!</title>
		<link>http://malsolo.com/blog4java/?p=465</link>
		<comments>http://malsolo.com/blog4java/?p=465#comments</comments>
		<pubDate>Thu, 23 Oct 2014 15:52:56 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Springsource]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[Orika]]></category>
		<category><![CDATA[POJO]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=465</guid>
		<description><![CDATA[I love good software, and Orika is a really interesting project. In this post I&#8217;m going to talk about this Java bean mapping framework that I&#8217;ve used recently and I highly recommend. Orika (formerly hosted at google code) claims to &#8230; <a href="http://malsolo.com/blog4java/?p=465">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I love good software, and Orika is a really interesting project. In this post I&#8217;m going to talk about this Java bean mapping framework that I&#8217;ve used recently and I highly recommend.</p>
<p><a href="http://orika-mapper.github.io/orika-docs/" title="Orika User Guide" target="_blank">Orika</a> (formerly hosted at <a href="https://code.google.com/p/orika/" title="Orika at google code" target="_blank">google code</a>) claims to be a <em>simpler, lighter and faster Java bean mapping</em>. And it really is.</p>
<p>It allows you to convert objects by copying its attributes from one to another. It performs this by using Java introspection, instead of XML configuration or something like that. It uses code generation to create the mappers, and it has an interesting strategy for its core classes that allows you to optimize the performance.</p>
<p>It is completely configurable, for instance, the java code generator by default is Javassist, but you can use EclipseJdt or even use another provider by implementing the appropriate interface.</p>
<p>Finally, it&#8217;s a very well documented project, with clear explanations and useful code.</p>
<p>I really like it.</p>
<p>If you want to try it, just add the next dependency to your maven project:</p>
<p></p><pre class="crayon-plain-tag">&lt;dependency&gt;
			&lt;groupId&gt;ma.glasnost.orika&lt;/groupId&gt;
			&lt;artifactId&gt;orika-core&lt;/artifactId&gt;
			&lt;version&gt;1.4.5&lt;/version&gt;&lt;!-- or latest version --&gt;
		&lt;/dependency&gt;</pre><p></p>
<p>Or <a href="https://github.com/orika-mapper/orika/releases" title="Orika releases at GitHub" target="_blank">download the library</a> along with three required libraries:</p>
<ul>
<li>javassist (v 3.12.0+)</li>
<li>slf4j (v 1.5.6+)</li>
<li>paranamer (v 2.0+)</li>
</ul>
<h1>Main concepts</h1>
<p>There are two core classes, the first one is <strong>MapperFactory</strong>, the class to configure the mappings and to obtain the second core class: <strong>MapperFacade</strong>, that actually provides the service of a Java bean mapping.</p>
<h3>MapperFactory</h3>
<p>By using a fluent API, you can construct a <strong>MapperFactory</strong> via its main implementation, <strong>DefaultMapperFactory</strong> and its static class helpers intended for building the <strong>MapperFactory</strong>.</p>
<p>Then you can obtain a <strong>ClassMapBuilder</strong> from the <strong>MapperFactory</strong> in order to declare the mapping configuration in a fluent-style, that is: mapping fields (bi-directional by default, or in one direction if you&#8217;d rather), excluding fields, specifying constructors and customizing mappings of Lists, Sets, nested fields and so on.</p>
<p>There is a default mapping that maps fields with matching names between two classes, and you can also register the mapping in the MapperFactory (the ClassMapBuilder is built with the very MapperFactory as atribute). Both operations have the appropriate methods to be called.</p>
<p>Let&#8217;s see an example:</p>
<p>We have two classes: <a href="https://github.com/jbbarquero/orika-test/blob/master/src/main/java/com/malsolo/orika/test/dto/PersonDTO.java" title="PersonDTO at github" target="_blank">PersonDTO</a> and <a href="https://github.com/jbbarquero/orika-test/blob/master/src/main/java/com/malsolo/orika/test/domain/Person.java" title="Person at github" target="_blank">Person</a>, and we want to convert one object for the former class to an object of the latter one, so let&#8217;s configure the MapperFactory:</p>
<p></p><pre class="crayon-plain-tag">MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.classMap(PersonDTO.class, Person.class) //A ClassMapBuilder&lt;PersonDTO, Person&gt;
        .field(&quot;lastNames&quot;, &quot;surnames&quot;) //Register field mappings
        .field(&quot;streetAddress&quot;, &quot;address.street&quot;)
        .field(&quot;city&quot;, &quot;address.city&quot;)
        .field(&quot;postalCode&quot;, &quot;address.zipCode&quot;)
        .byDefault() //the remaining fields on both classes should be mapped matching the fields by name
        .register(); //register the mapping with the MapperFactory.</pre><p></p>
<p>The <strong>ClassMapBuilder</strong> provides interesting mappings for excluding fields, mapping fields in one direction only (as I mentioned above, mapping is by default bi-directional) and so on. See the <a href="http://orika-mapper.github.io/orika-docs/mappings-via-classmapbuilder.html" title="Declarative Mapping Configuration: using the fluent-style ClassMapBuilder API " target="_blank">Declarative Mapping Configuration</a> and <a href="http://orika-mapper.github.io/orika-docs/advanced-mappings.html" title="Advanced Mapping Configurations: beyond the basics of ClassMapBuilder API" target="_blank">Advanced Mapping Configurations</a> for more options.</p>
<h3>MapperFacade and BoundMapperFacade</h3>
<p>The <strong>MapperFacade</strong> performs the actual mapping work, for doing so, you have to obtain the MapperFacade from the MapperFactory and then use its map methods. There are two general options, <strong><em>map(objectA, B.class)</em></strong>, which will create a new instance of B.class and map the property values of objectA onto it, or <strong><em>map(objectA, objectB)</em></strong>, which copies properties from objectA onto objectB, being both of them not null.</p>
<p>Let&#8217;s see an example: </p>
<p></p><pre class="crayon-plain-tag">MapperFacade mapper = mapperFactory.getMapperFacade();
PersonDTO personDTO = new PersonDTO();
//Set values here
Person person = mapper.map(personDTO, Person.class);
//Alternatively:
//Person person = new Person();
//mapper.map(personDTO, person);</pre><p></p>
<p>The <strong>BoundMapperFacade</strong> is intended to be used with a pair of types to map and no further customization needed. It provides improved performance over use of the standard <strong>MapperFacade</strong> and it has the same usage plus a <strong><em>mapReverse</em></strong> method for mapping in the reverse direction.</p>
<p>See below an example:</p>
<p></p><pre class="crayon-plain-tag">BoundMapperFacade&lt;PersonDTO, Person&gt; boundMapper = mapperFactory.getMapperFacade(PersonDTO.class, Person.class);
PersonDTO personDTO = new PersonDTO();
//Set values here
Person person = boundMapper.map(personDTO);
//Alternatively:
//Person person = new Person();
//boundMapper.map(personDTO, person);
//Map in the reverse
PersonDTO personDTO = boundMapper.mapReverse(person);
//Alternatively with no null objects:
//boundMapper.mapReverse(person, personDTO); //curiously, it returns an A object instead of void</pre><p></p>
<p>If you’re primarily concerned with the mapping of a particular type to another, and your object graph has no cycles, use <strong>BoundMapperFacade</strong> because it has <u>better performance</u>, since you avoid the overhead of looking up an appropriate mapping strategy for the fields of the objects to be mapped, that happens when you call the map method.</p>
<h3>Performance</h3>
<p>The most expensive operations are instantiation and initialization of the MapperFactory, and the MapperFacade which is obtained from it.</p>
<p>Both of them are thread-safe objects, thus singletons or static access for them are a very recommended approach.</p>
<p>For instance, you can consider an static acces to the MapperFactory:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.domain.mappers;

import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;

public class BaseMapper {
    final static MapperFactory MAPPER_FACTORY = new DefaultMapperFactory.Builder().build();
}</pre><p></p>
<p>And then use this class for registering class maps and access to the MapperFacade in a customize way:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.domain.mappers;

import com.malsolo.orika.test.domain.Customer;
import com.malsolo.orika.test.dto.CustomerDTO;
import ma.glasnost.orika.MapperFacade;

public enum CustomerMapper {
    
    INSTANCE;
    
    private final MapperFacade mapperFacade;
    
    private CustomerMapper() {
        BaseMapper.MAPPER_FACTORY.classMap(CustomerDTO.class, Customer.class)
                .byDefault()
                .register();
        mapperFacade = BaseMapper.MAPPER_FACTORY.getMapperFacade();
    }
    
    public Customer map(CustomerDTO customerDTO) {
        return this.mapperFacade.map(customerDTO, Customer.class);
    }
    
    public CustomerDTO map(Customer customer) {
        return this.mapperFacade.map(customer, CustomerDTO.class);
    }
}</pre><p></p>
<p>In this case I&#8217;m using two new classes: <a href="https://github.com/jbbarquero/orika-test/blob/master/src/main/java/com/malsolo/orika/test/domain/Customer.java" title="Customer at GitHub" target="_blank">Customer</a> and <a href="https://github.com/jbbarquero/orika-test/blob/master/src/main/java/com/malsolo/orika/test/dto/CustomerDTO.java" title="CustomerDTO at GitHub" target="_blank">CustomerDTO</a>.</p>
<p>Finally, just use this helper classes:</p>
<p></p><pre class="crayon-plain-tag">CustomerDTO customerDTO = new CustomerDTO();
//Setters at will
Customer customer = CustomerMapper.INSTANCE.map(customerDTO);</pre><p></p>
<h1>How it works and Customization</h1>
<p>The best way to understand how Orika works is to read the <a href="http://orika-mapper.github.io/orika-docs/faq.html" title="Orika FAQ" target="_blank">FAQ</a>, but the source code is very clear and easy to follow, just in case  you want to take a deeper look to the details.</p>
<p><em>&#8220;Orika uses reflection to investigate the metadata of the objects to be mapped and then generates byte-code at runtime which is used to map those classes [&#8230;]&#8221;</em></p>
<p><em>&#8220;Orika mapping is configured via Java code at runtime, via a fluent-style ClassMapBuilder API. An instance is obtained from a MapperFactory which is then used to describe the mapping from one type to another. Finally, the specified ClassMap is registered with the MapperFactory for later use in generating a byte-code mapper.&#8221;</em></p>
<p>To configure Orika, the author recommends to extend the ConfigurableMapper class, and I will use this approach for using Orika with Spring (see below)</p>
<p>If you want to configure the code generation, compilation and so on, see how to do this using the MapperFactory in the next topic.</p>
<h3>MapperFactory Configuration</h3>
<p>The core class <strong>MapperFactory</strong> is instantiated as you&#8217;ve seen above, by building the provided implementation: <strong>DefaultMapperFactory</strong>. It uses a set of Strategy and factory objects for resolving constructors, for compiling code (actually, they belong to its inner static class <strong>MapperFactoryBuilder</strong> that is extended by its other inner static class that you use to instantiate the MapperFactory: the <strong>Builder</strong>), for resolving properties, and specially for building class maps.</p>
<p>So you can customize all of them after calling <strong><em>Builder</em>()</strong> and before the <strong><em>build()</em></strong> method:</p>
<p></p><pre class="crayon-plain-tag">new DefaultMapperFactory.Builder()
.constructorResolverStrategy(new SimpleConstructorResolverStrategy()) //By default, you can extend it or implement your own ConstructorResolverStrategy
.compilerStrategy(new JavassistCompilerStrategy()) //By default, you can extend it, implement your own CompilerStrategy or use EclipseJdtCompilerStrategy
.propertyResolverStrategy(new IntrospectorPropertyResolver()) //By default, you can extend it or implement your own PropertyResolverStrategy
.classMapBuilderFactory(new ClassMapBuilder.Factory()) //by default. You can use //enabled by default or //enabled by default.Factory
.useAutoMapping(true) //enabled by default
.mapNulls(true) //enabled by default
.build();</pre><p></p>
<h3>Custom Mappers</h3>
<p>A <strong><em>Mapper&lt;A, B&gt;</em></strong> copies the properties from one object onto another and it&#8217;s used internally by Orika (MapperFacade, MapperGenerator and MapperFactory use it, but it isn&#8217;t really interesting for this post, actually)</p>
<p>If you want to take control of how properties of one object instance are copied to another object instance (not null), just extends the abstract class <strong><em>CustomMapper&lt;A,B&gt;</em></strong>.</p>
<p>Then, you can register your custom mapper in the <strong>MapperFactory</strong> via its method <strong><em>registerMapper(Mapper&lt;A, B&gt; mapper)</em></strong>.</p>
<p>It&#8217;s intended to be used when the mapping behavior configured via the ClassMapBuilder API doesn’t suit your purposes, but only to copy properties, that is, the destination object already exists. If you want to control instantiation, use a CustomConverter or ObjectFactory which both return an instance. See below.</p>
<p>If you need to map nested members of the given object, you can doing so by using the current <strong>MapperFacade</strong> that it&#8217;s accessible via a protected <strong><em>mapperFacade</em></strong> variable. </p>
<p>I&#8217;ve used converters in a Spring applications as components that can be scanned and used to configure the MapperFactory by extending ConfigurableMapper as I mentioned above and I&#8217;ll show below.</p>
<h3>Object Factories</h3>
<p>An <strong><em>ObjectFactory&lt;D&gt;</em></strong> instantiates objects. You can implement this interface and register your implementation in the MapperFactory via their method <strong><em>registerObjectFactory</em></strong> (there are a couple of them)</p>
<p>I&#8217;ve never used this option.</p>
<h3>Custom Converters</h3>
<p>A <strong><em>Converter&lt;S, D&gt;</em></strong> combines both ObjectFactory and Mapper together, returning a new instance of the destination type with all properties copied from the source instance.</p>
<p>When you want to take complete control over the instantiation and mapping, just extend <strong><em>CustomConverter&lt;S, D&gt;</em></strong> to create the new instance and to provide it the properties from the source object.</p>
<p>Then, you can register your custom converter in the MapperFactory by obtaining its <strong>ConverterFactory</strong> via the <strong><em>getConverterFactory()</em></strong> method and then using one of its <strong><em>registerConverter()</em></strong> methods.</p>
<p>I&#8217;ve found this option useful when you want to create some hard conversion between classes that has the same meaning in your code but are not really related in terms of Java. Well, it&#8217;s a conversion, let&#8217;s say, from a date represented in a String and a date that has to be a Calendar. You have to use some formatter for doing so.</p>
<p>It&#8217;s also very easy to configure converters as Spring components if you need so.</p>
<h1>Using Orika with Spring</h1>
<p>Since the Orika core classes <strong>MapperFactory</strong> and the <strong>MapperFacade</strong> obtained from it are very expensive to instantiate and initialize, but at the same time are thread-safe, they should be shared as singletons. That is, they are good candidates for being Spring beans with singleton scope.</p>
<p>Let&#8217;s start with using spring-framework in a maven project,just add the next dependency to the pom.xml file:</p>
<p></p><pre class="crayon-plain-tag">&lt;dependency&gt;
			&lt;groupId&gt;org.springframework&lt;/groupId&gt;
			&lt;artifactId&gt;spring-context&lt;/artifactId&gt;
			&lt;version&gt;4.1.1.RELEASE&lt;/version&gt;&lt;!-- or latest version --&gt;
		&lt;/dependency&gt;</pre><p></p>
<h3>The Spring application</h3>
<p>Let&#8217;s create a couple of beans to obtain a Person and a PersonDTO, let&#8217;s call them service and repository respectively:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import com.malsolo.orika.test.domain.Person;

public interface PersonService {
    
    public Person obtainPerson();
    
}</pre><p></p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import com.malsolo.orika.test.dto.PersonDTO;

public interface PersonRepository {
    
    public PersonDTO obtainPerson();

}</pre><p></p>
<p>And their implementations, the one for the service will use the repository interface, and the one for the repository will be a simple in-memory implementation.</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import com.google.common.collect.ImmutableList;
import com.malsolo.orika.test.dto.PersonDTO;
import java.util.Random;
import org.springframework.stereotype.Repository;

@Repository
public class PersonRepositoryImpl implements PersonRepository {
    
    Random random = new Random();

    @Override
    public PersonDTO findPerson() {
        return this.createPersonDTO(random.nextLong());
    }

    private PersonDTO createPersonDTO(long l) {
        PersonDTO dto = new PersonDTO();
        dto.setId(l);
        //More setters here
        return dto;
    }
}</pre><p></p>
<p>Note that the service will need to convert from the DTO to the domain object, so let&#8217;s inject a mapper.</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import com.malsolo.orika.test.domain.Person;
import ma.glasnost.orika.MapperFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PersonServiceImpl implements PersonService {
    
    @Autowired
    private PersonRepository personRepository;
    
    private MapperFacade mapper;

    @Autowired
    public void setMapperFactory(MapperFactory mapperFactory) {
        this.mapper = mapperFactory.getMapperFacade();
    }
    
    @Override
    public Person obtainPerson() {
        return mapper.map(this.personRepository.findPerson(), Person.class);
    }

}</pre><p></p>
<p>As you can see, I used setter injection (via autowiring) to provide a MapperFactory in order to obtain from it a MapperFacade. I&#8217;m using the suggestion of having the MapperFactory as singleton, that it&#8217;s easy to achieve with Spring.</p>
<p>Since MapperFactory has a particular way to be instantiated, the best option is to create a factory for exposing it, a FactoryBean:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class MapperFactoryFactory implements FactoryBean&lt;MapperFactory&gt; {

    @Override
    public MapperFactory getObject() throws Exception {
        return new DefaultMapperFactory.Builder().build();
    }

    @Override
    public Class&lt;?&gt; getObjectType() {
        return MapperFactory.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

}</pre><p></p>
<p>This approach has been selected just in case I want to use a BoundMapperFacade, but it&#8217;s possible to use a MapperFacade directly by creating a <a href="http://github" title="title" target="_blank">MapperFacadeFactory</a>.</p>
<p>Now, let&#8217;s configure the Spring application</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
public class OrikaSpringTest {
    
    public static void main(String... args) {
        ApplicationContext context = 
          new AnnotationConfigApplicationContext(OrikaSpringTest.class);
        PersonService personService = context.getBean(PersonService.class);
        Person person = personService.obtainPerson();
        System.out.printf(&quot;%s\n&quot;, person.toString());
    }

}</pre><p></p>
<p>This is enough for the project to run:</p>
<p></p><pre class="crayon-plain-tag">Person{id=0, name=Name 0, surnames=null, address=null}</pre><p></p>
<p>But <strong><u>pay attention</u></strong>, the mapper didn&#8217;t work, because there are differences between the two classes (tow attributes with different names, and the same concept, address, with different types)</p>
<h3>Plugging in Orika Mappers and Converters with Spring</h3>
<p>Orika provides custom converters and mappers, so the only thing we need is to configure them as spring beans in the application context. Let&#8217;s see how to do this.</p>
<p>First, we need a custom mapper. We annotate it as component to be discovered (via component scanning) by Spring.</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import com.malsolo.orika.test.domain.Address;
import com.malsolo.orika.test.domain.Person;
import com.malsolo.orika.test.dto.PersonDTO;
import ma.glasnost.orika.CustomMapper;
import ma.glasnost.orika.MappingContext;
import org.springframework.stereotype.Component;

@Component
public class PersonDtoToPersonMapper extends CustomMapper&lt;PersonDTO, Person&gt; {

    @Override
    public void mapAtoB(PersonDTO a, Person b, MappingContext context) {
        b.setId(a.getId());
        b.setName(a.getName());
        b.setSurnames(a.getLastNames());
        //I could use the protected mapperFacade if I need to map a particular field
        //this.mapperFacade.map(sourceObject, destinationClass);
        Address address = new Address();
        address.setStreet(a.getStreetAddress());
        address.setCity(a.getCity());
        address.setZipCode(a.getPostalCode());
        b.setAddress(address);
    }

    @Override
    public void mapBtoA(Person b, PersonDTO a, MappingContext context) {
        a.setId(b.getId());
        a.setName(b.getName());
        a.setLastNames(b.getSurnames());
        Address address = b.getAddress();
        if (address != null) {
            a.setStreetAddress(address.getStreet());
            a.setCity(address.getCity());
            a.setPostalCode(address.getZipCode());
        }
    }

}</pre><p></p>
<p>Finally, we have to plug in mappers and converters that belongs to the Spring application context, into the MapperFactory. If we extend <strong>ConfigurableMapper</strong> we will have a MapperFactory created for us, and later on, the chance to access the application context itself to look up for the custom mappers and converters that are Spring components to register them in the MapperFactory.</p>
<p>Let&#8217;s show the code:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import java.util.Map;
import ma.glasnost.orika.Converter;
import ma.glasnost.orika.Mapper;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.ConfigurableMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class SpringConfigurableMapper extends ConfigurableMapper {

    private ApplicationContext applicationContext;

    private MapperFactory mapperFactory;

    @Autowired
    public void setApplicationContext(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
        addSpringMappers();
        addSpringConverter();
    }

    @Override
    protected void configure(MapperFactory factory) {
        super.configure(factory);
        this.mapperFactory = factory;
    }

    private void addSpringMappers() {
        @SuppressWarnings(&quot;rawtypes&quot;)
        final Map&lt;String, Mapper&gt; mappers = applicationContext
                .getBeansOfType(Mapper.class);
        for (final Mapper&lt;?, ?&gt; mapper : mappers.values()) {
            addMapper(mapper);
        }
    }

    private void addMapper(Mapper&lt;?, ?&gt; mapper) {
        this.mapperFactory.registerMapper(mapper);
    }

    private void addSpringConverter() {
        @SuppressWarnings(&quot;rawtypes&quot;)
		final Map&lt;String, Converter&gt; converters = applicationContext
                .getBeansOfType(Converter.class);
        for (final Converter&lt;?, ?&gt; converter : converters.values()) {
            addConverter(converter);
        }
    }

    private void addConverter(Converter&lt;?, ?&gt; converter) {
        this.mapperFactory.getConverterFactory().registerConverter(converter);
    }

}</pre><p></p>
<p>Some important things to note here:</p>
<ul>
<li>Our class SpringConfigurableMapper is a @Component</li>
<p>When Spring instantiates it, it will call its constructor that is inherited from <strong>ConfigurableMapper</strong> and it calls an init method that creates a MapperFactory and allows you to configure via the overriden method. </p>
<p>So, the first method called is <strong><em>configure(MapperFactory)</em></strong>.</p>
<p>Furthermore, don&#8217;t create your own MapperFactory as I did above, because it won&#8217;t be the one you&#8217;ll use to register the mappers and converters, on the contrary, this class will create a new MapperFactory.</p>
<li>Our class SpringConfigurableMapper has the ApplicationContext @Autowired</li>
<p>It&#8217;s the same as if you implement ApplicationContextAware, but I&#8217;d rather this approach.</p>
<p>Besides, it implies that the method will be called after all the beans have been created. Since you already have a MapperFactory, you can then search for custom components and converters that are spring beans and register them in the MapperFactory.</p>
<li>Our class extends ConfigurableMapper that implements MapperFacade</li>
<p>So, you have to slightly change the PersonServiceImpl and it&#8217;s better to not have a MapperFacadeFactory or you will have an autowiring exception because there would be two beans of the MapperFacade class:</p>
<p></p><pre class="crayon-plain-tag">package com.malsolo.orika.test.spring;

import ma.glasnost.orika.MapperFacade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.malsolo.orika.test.domain.Person;

@Service
public class PersonServiceImpl implements PersonService {
    
    @Autowired
    private PersonRepository personRepository;
    
    @Autowired
    private MapperFacade mapper;

    @Override
    public Person obtainPerson() {
        return mapper.map(this.personRepository.findPerson(), Person.class);
    }

}</pre><p></p>
<p>Now, if you run the Orika with Spring main class, <a href="https://github.com/jbbarquero/orika-test/blob/master/src/main/java/com/malsolo/orika/test/spring/OrikaSpringTest.java" title="Orika Spring test at GitHub" target="_blank">OrikaSpringTest</a>, everything will run as expected:</p>
<p></p><pre class="crayon-plain-tag">Person{id=85, name=Name 85, surnames=[S., Surname 85], address=Address{street=My street 85, city=City 85, zipCode=code 85}}</pre><p></p>
<h1>Resources</h1>
<ul>
<li><a href="https://github.com/jbbarquero/orika-test" title="Source code at GitHub" target="_blank">Source code</a> for this post</li>
<li><a href="http://orika-mapper.github.io/orika-docs/" title="Orika user guide" target="_blank">Orika User Guide</a></li>
<li><a href="http://kenblair.net/orika-spring-easy-bean-mapping/" title="Orika and Spring Framework = easy bean mapping" target="_blank">Orika and Spring Framework = easy bean mapping</a> by Ken Blair</li>
<li><a href="http://projects.spring.io/spring-framework/#quick-start" title="Spring Framework Quick Start" target="_blank">Spring Framework Quick Start</a></li>
<li><a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#extensible-xml-meat" title="Spring Framework Reference Documentation: 35.7. Meatier examples" target="_blank">Spring Framework Reference Documentation (Meatier examples)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=465</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Just for fun: trying the best 3 IDEs for Java</title>
		<link>http://malsolo.com/blog4java/?p=228</link>
		<comments>http://malsolo.com/blog4java/?p=228#comments</comments>
		<pubDate>Fri, 08 Aug 2014 12:52:45 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Springsource]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[IntelliJ IDEA]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Spring Tool Suite]]></category>
		<category><![CDATA[STS]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=228</guid>
		<description><![CDATA[Not only for fun. It&#8217;s also to open my mind. Introduction Since a few years ago, I try to use several OS in order to improve my computing skills: Windows 7/Vista, OS X (Lion currently) and my favorite Linux distribution, &#8230; <a href="http://malsolo.com/blog4java/?p=228">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Not only for fun. It&#8217;s also to open my mind.</p>
<h3>Introduction</h3>
<p>Since a few years ago, I try to use several OS in order to improve my computing skills: Windows 7/Vista, OS X (Lion currently) and my favorite Linux distribution, Ubuntu (Sheldon Cooper dixit). You can also include Android (my wife&#8217;s smartphone) and iOS (my iPhone and our iPad)</p>
<p>Suddenly, I realize that I&#8217;ve been enriched, and you’re able to do a lot of more things because you have your mind really prepared for thinking instead of conditioned by a single line of sight.</p>
<p>I observed the same improvement when I began to use Maven for Java development. I didn&#8217;t quit my IDE, but regarding compilation, the important things are the source code and bytecode. You shouldn&#8217;t think about settings, preferences, project configuration and some other artificial stuff that the IDE needs, but that is not your concern.</p>
<p>So I&#8217;ve decided to try the 3 most popular IDEs for Java currently available.</p>
<h3>Context</h3>
<p>During the last 2 months, I&#8217;ve been changing between projects I work in more quickly than I used to be accustomed, and that has allowed me to choose the IDE for working.</p>
<p>The title says it&#8217;s been for fun, but I&#8217;m using them in professional environment. Besides, the goal is not to decide which is better (it&#8217;s hard to be that rude with the others) or worst (well, it seems it&#8217;s an easy decision, because the worst Java IDE is <strong>JDeveloper</strong>, doubtless). What I want to find out is which of them is more productive for me.</p>
<p>Let&#8217;s see the first impressions.</p>
<h3>Eclipse</h3>
<p>Actually I don&#8217;t use Eclipse, but <a href="http://spring.io/tools/sts" title="Spring Tool Suite" target="_blank">Spring Tool Suite</a>, <em>&#8220;an Eclipse-based development environment that is customized for developing Spring applications&#8221;</em>. You know, Eclipse on Spring steroids.</p>
<p><u>I&#8217;ve been using Eclipse as my main IDE for years</u>, even before it was released (Visual Age for Java was the IDE that I used in my first professional project). Thus, I&#8217;m very used to writing programs with Eclipse. </p>
<p>The version that I&#8217;m currently using is 3.6.0, that is based on Eclipse 4.4 (Luna)</p>
<p>Let&#8217;s summarize my first impressions:</p>
<p>Pros:</p>
<ul>
<li>It comes in a compressed file, no native installer. That allows me to place the program in the same location on every OS (in my case, an Application folder within my user home)</li>
<li>The shortcut keys</li>
<li>Typing assistant. I love to type &#8220;main&#8221; and have an entire main method written, or &#8220;sysout&#8221; and obtain a complete log sentence.</li>
<li>The view and the perspectives is the most interesting way of organizing the IDE</li>
</ul>
<p>Cons:</p>
<ul>
<li>It crashes from time to time. Annoying.</li>
<li>It seems to consume a lot of memory</li>
<li>The TC server that it includes is based on Tomcat 7, so it doesn&#8217;t recognize Servlet 3.1 projects</li>
<li>A custom way of building code. No native support for tools like maven, gradle or ant. There are appropriate plugins, but having to update Eclipse projects to reflect maven changes is somewhat annoying</li>
<li>On Ubuntu and on OS X, the icon in the Docker runs the previously installed 3.5.1 version. Maybe is the OS fault, due to the lack of installation.
</ul>
<h3>NetBeans</h3>
<p>I&#8217;m talking about <a href="https://netbeans.org/" title="NetBeans 8.0" target="_blank">NetBeans 8.0</a>.</p>
<p>It&#8217;s hard for me to evaluate Eclipse, because it is the IDE that I use on a daily basis since a long years ago.</p>
<p>On the other hand, it&#8217;s very easy to describe the first impressions with NetBeans.</p>
<p>The installer works fine and the application runs smoothly, but I miss the way Eclipse are organized and its shortcuts (delete line: Ctrl/Cmd+D vs Ctrl/Cmd+E)</p>
<p>However <u>NetBeans is likely the best among the three IDEs</u> (not so hard to decide, apparently)</p>
<p>I got used to NetBeans in a few hours. Yes, hours. NetBeans has the more natural appearance for programming.</p>
<p>Actually, it includes all the options that Eclipse has, but sometimes with different key combination.</p>
<p>Besides, NetBeans is pure Java using external tools for compiling (maven, for instance)</p>
<p>Furthermore, it comes with Tomcat and GlassFish and a several of useful tools easy to configure with pluggins.</p>
<p>Does it have flaws? Of course, sometimes it get locked in a long wait operation and you can do nothing but wait.</p>
<p>Another tricky issue is that it uses an external tool to compile, maven for instance, so the program doesn&#8217;t exist until the project is built and neither you have the dependencies until maven downloads them. But worst than that is, if you compile successfully, but later on you introduce a compilation error, when you execute again, it runs the previously compiled version, because the current can&#8217;t be compiled due to the error.</p>
<p>Eclipse shows you an alert if there are compilation errors in your project before executing it.</p>
<h3>IntelliJ IDEA</h3>
<p>I&#8217;m sure that this is the best IDE ever, it seems so, but it makes me a little bit unproductive.</p>
<p>Eclipse is some kind of a de facto standard, and NetBeans is an easy to use program. But thanks to <a href="http://www.jetbrains.com/idea/" title="IntelliJ IDEA 13.1" target="_blank">IntelliJ IDEA 13.1</a>, the JetBrains Web Help has been the most visited page this week.</p>
<p>Besides, I don&#8217;t know what is doing the IDE. I don&#8217;t know whether the files are saved automatically, I don&#8217;t know when compilation is performed, and so on.</p>
<p>The worst thing in my humble opinion is that it doesn&#8217;t have any application server in the community edition. Please, at least Tomcat. But it has not.</p>
<p>Regarding shortcuts, it uses Ctrl/Cmd+Y for deleting lines, seriously?, the universal shortcut for “redo”? Yepes. And the rest of shortcut keys are really hard to do (Ctrl+F4 for closing a file)</p>
<p>I will try it later again, but currently it&#8217;s not my preferred choice.</p>
<p>However, once you discover how to use it, it&#8217;s the one that runs better. It seems not consume a lot of memory and it never blocks nor has crashes.</p>
<p>On Ubuntu, I have to start it via command line.</p>
<h3>Summary</h3>
<p>Of course the three programs are very good IDEs, but one by one:</p>
<ul>
<li>I feel a little bit lost with IntelliJ IDEA. It&#8217;s great but it&#8217;s hard to find the standard options.</li>
<li>I love Eclipse and its shortcut keys, and I don&#8217;t care its flaws because I&#8217;m used to them after all these years. It will be my preferred IDE for a while, but NetBeans is now here.</li>
<li>I didn&#8217;t like NetBeans, but the version 8 is a great program. It doesn&#8217;t matter if you haven&#8217;t use it before, is a very natural program. It makes Java development the way it has to be. Now I like it a lot.</li>
</ul>
<p>Some final words: they are all very good and easy to use for Java debugging. And I&#8217;m glad now I can use any of them if I had to.</p>
<p>An alternative for short projects is a text editor (Sublime Text, for instance) and a good build tool (maven or gradle, as you wish)</p>
<p>I have to try Web Based IDEs, <a href="http://nerds-central.blogspot.co.uk/2014/08/10-kickass-software-technologies.html" title="10 Kickass (software) Technologies - Gauntlet Picked Up" target="_blank">as Alexander J Turner suggested</a>.</p>
<p>That&#8217;s all for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=228</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tuesday&#8217;s programming buzzwords &#8211; July 22th, 2014</title>
		<link>http://malsolo.com/blog4java/?p=198</link>
		<comments>http://malsolo.com/blog4java/?p=198#comments</comments>
		<pubDate>Wed, 23 Jul 2014 11:36:44 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Activiti]]></category>
		<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[BPM]]></category>
		<category><![CDATA[BPMN]]></category>
		<category><![CDATA[ECM]]></category>
		<category><![CDATA[Liferay]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=198</guid>
		<description><![CDATA[Liferay, Alfresco, Activiti, BPM, BPMN, ECM. Liferay Portal is a Java-based open source portal. A portal is generally defined as a software platform for building websites and web applications, with features for building the views and accessing data repositories. It &#8230; <a href="http://malsolo.com/blog4java/?p=198">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Liferay</strong>, <strong>Alfresco</strong>, <strong>Activiti</strong>, <strong>BPM</strong>, <strong>BPMN</strong>, <strong>ECM</strong>.</p>
<p><a href="http://www.liferay.com/en/products/liferay-portal/overview" title="Liferay Portal" target="_blank">Liferay Portal</a> is a Java-based open source portal. A portal is generally defined as a software platform for building websites and web applications, with features for building the views and accessing data repositories. It is used also for Web Content Management System (accesing documents), and as a platform for collaboration or social interaction.</p>
<p><a href="http://www.alfresco.com/solutions" title="Alfresco" target="_blank">Alfresco</a> is a <a href="http://en.wikipedia.org/wiki/Enterprise_Content_Management" title="Enterprise content management" target="_blank">Enterprise Content Manager</a> (ECM), that is, a software for Document Management, Collaboration (external access to the documents), Process Management (definition of process) and more.</p>
<p><a href="http://activiti.org/" title="Activiti" target="_blank">Activiti BPM Platform</a> is a Java light-weight workflow and <a href="http://en.wikipedia.org/wiki/Business_process_management" title="Business process management" target="_blank">Business Process Management</a> (<a href="http://en.wikipedia.org/wiki/Business_process_management" title="Business process management" target="_blank">Business Process Management</a>BPM</a>) Platform with a <a href="http://en.wikipedia.org/wiki/Business_Process_Model_and_Notation#BPMN_2.0" title="BPMN 2.0" target="_blank">BPMN 2</a>process engine. It&#8217;s open-source and distributed under the Apache license. </p>
<p><a href="http://en.wikipedia.org/wiki/Business_process_management" title="Business process management" target="_blank">Business Process Management</a>Business process management</a> (<a href="http://en.wikipedia.org/wiki/Business_process_management" title="Business process management" target="_blank">Business Process Management</a>BPM</a>) is a management discipline for defining process of an organization with the goal of optimization. In practice, <a href="http://en.wikipedia.org/wiki/Business_Process_Model_and_Notation" title="Business Process Model and Notation" target="_blank">Business Process Model and Notation</a> (<a href="http://en.wikipedia.org/wiki/Business_Process_Model_and_Notation" title="Business Process Model and Notation" target="_blank">BPMN</a>) is used for provide a graphical representation of the business processes in a business process model (<a href="http://en.wikipedia.org/wiki/Business_process_management" title="Business process management" target="_blank">Business Process Management</a>BPM</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=198</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moday&#8217;s programming buzzwords &#8211; July 21th, 2014</title>
		<link>http://malsolo.com/blog4java/?p=195</link>
		<comments>http://malsolo.com/blog4java/?p=195#comments</comments>
		<pubDate>Wed, 23 Jul 2014 11:02:35 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[C10K problem]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Vert.x]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=195</guid>
		<description><![CDATA[Vert.x, C10k problem, Node.js, MongoDB. Vert.x is a application platform, that claims to be lightweight and high performance, and it&#8217;s for the JVM. To summarize, is a Java (and JavaScript, CoffeeScript, Ruby, Python or Groovy) Async I/O platform. Node.js is &#8230; <a href="http://malsolo.com/blog4java/?p=195">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>Vert.x</strong>, <strong>C10k problem</strong>, <strong>Node.js</strong>, <strong>MongoDB</strong>.</p>
<p><a href="http://vertx.io/" title="Vert.x" target="_blank">Vert.x</a> is a application platform, that claims to be lightweight and high performance, and it&#8217;s for the JVM. To summarize, is a Java (and JavaScript, CoffeeScript, Ruby, Python or Groovy) <a href="http://en.wikipedia.org/wiki/Asynchronous_I/O" title="Asynchronous I/O" target="_blank">Async I/O</a> platform.</p>
<p><a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a> is a platform built on Chrome&#8217;s JavaScript runtime. Once again, event-driven, non-blocking I/O model.</p>
<p>Both of them are intended for solving the <a href="http://www.kegel.com/c10k.html" title="The C10K problem" target="_blank">C10k problem</a>.</p>
<p>For doing so, they follow the <a href="http://en.wikipedia.org/wiki/Reactor_pattern" title="Reactor pattern" target="_blank">Reactor Pattern</a>. It consists in an event loop that waits for Events that are handle concurrently by delivering these events to the appropriate service handler.</p>
<p>The main differences between <a href="http://vertx.io/" title="Vert.x" target="_blank">Vert.x</a> and <a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a> is that the former has several threads as event loops (one per core) and the latter has one thread only, besides, <a href="http://vertx.io/" title="Vert.x" target="_blank">Vert.x</a> has special components (called <a href="http://vertx.io/manual.html#writing-blocking-code-introducing-worker-verticles" title="Writing blocking code - introducing Worker Verticles" target="_blank">Worker Verticles</a>) for writing blocking code (long-lived computationally intensive operation, calling third party components, as JDBC queries), so that you can avoid to block the event loop.</p>
<p><a href="http://en.wikipedia.org/wiki/C10k_problem" title="C10k problem" target="_blank">C10K problem</a> is the problem of having to handle suddenly a thousand of clients at the same time with a server that has to handle only several requests as its normal task (I mean, it&#8217;s a huge waste to configure this server for an average of thousands of connections only for occasional peaks)</p>
<p><a href="http://www.mongodb.org/" title="MongoDB" target="_blank">MongoDB</a> is an open-source document database, NoSQL database. <a href="http://www.mongodb.org/about/introduction/" title="Introduction to MongoDB" target="_blank">It claims</a> to provide high performanc (fast reads and writes), high availability (with replicated servers), and easy scalability (with automatic <a href="http://docs.mongodb.org/manual/core/sharding/" title="Sharding Concepts" target="_blank">sharding</a> among the servers).</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=195</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improving Java EE skills (including Spring)</title>
		<link>http://malsolo.com/blog4java/?p=79</link>
		<comments>http://malsolo.com/blog4java/?p=79#comments</comments>
		<pubDate>Fri, 18 Jul 2014 08:28:22 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Springsource]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Spring Framework]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=79</guid>
		<description><![CDATA[A friend of mine has requested me some help for improving his skills in Java EE and Spring Framework. An exciting question, indeed. The general context He&#8217;s working for a company since 2008. To work for a company for a &#8230; <a href="http://malsolo.com/blog4java/?p=79">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A friend of mine has requested me some help for improving his skills in Java EE and Spring Framework.</p>
<p>An exciting question, indeed.</p>
<h4>The general context</h4>
<p>He&#8217;s working for a company since 2008. To work for a company for a long time has a lot of pros, but a couple of drawbacks, being one of them a little bit worrying: the chance of obsolescence.</p>
<p>If you&#8217;re using the same environment along the years, let&#8217;s say <a href="http://www-01.ibm.com/software/websphere/solutions/" title="IBM WebSphere" target="_blank">IBM products</a>, you&#8217;ll loose the chance to discover other approaches, for instance <a href="http://www.oracle.com/us/products/middleware/cloud-app-foundation/weblogic/suite/overview/index.html" title="Oracle WebLogic" target="_blank">Oracle solutions</a>, or even better, <a href="http://projects.apache.org/" title="The Apache Software Foundation Projects" target="_blank">open source projects</a>.</p>
<p>Even worst, if the company are not willing to upgrade their products (that is very reasonable if there are budget concerns) or their libraries (that is really unwise, or the direct consequence that you don&#8217;t have a good testing process) suddenly you find yourself that you&#8217;re out of the market.</p>
<p>This is not really a problem as long as your current technology is the best technology for your needs, but sooner or later you have to face to the <a href="http://en.wikipedia.org/wiki/Technical_debt" title="Technical debt from Wikipedia" target="_blank">technical debt</a> (a really <a href="http://martinfowler.com/bliki/TechnicalDebt.html" title="Martin Fowler's TechnicalDebt" target="_blank">interesting topic</a> that <a href="http://blog.codinghorror.com/paying-down-your-technical-debt/" title="Paying Down Your Technical Debt" target="_blank">you should care about</a>). This day will happen when you&#8217;re spending more time in fixing issues than in adding new features to your software.</p>
<p>The problem continues if you try to reinventing the wheel or if you don&#8217;t realize that the plane is already invented. It&#8217;s 21st century, you can fly with the appropriate machine.</p>
<h4>The particular concern</h4>
<p>As I said at the beginning of this entry, he is a <a href="http://www.oracle.com/technetwork/java/javaee/overview/index.html" title="Java EE Overview" target="_blank">Java EE</a> developer that uses <a href="https://spring.io/" title="Spring" target="_blank">Spring Framework</a> in his daily work. But he still has to program for <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21570083" title="End of Support for WebSphere Application Server 6.1" target="_blank">WebSphere Application Server 6.1</a> (a.k.a. WAS 6.1, that is <a href="http://en.wikipedia.org/wiki/Java_EE_version_history#J2EE_1.4_.28November_11.2C_2003.29" title="Wikipedia J2EE 1.4" target="_blank">Java EE 1.4</a> compliance using <a href="http://www.oracle.com/technetwork/java/eol-135779.html" title="Oracle Java SE Support Roadmap" target="_blank">Java 5 SE</a>) using <a href="http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/" title="Spring Framework 3.0 Reference Documentation" target="_blank">Spring framework 3</a> (<a href="https://spring.io/blog/2007/11/19/spring-framework-2-5-released" title="Spring Framework 2.5 released" target="_blank">2.5</a> for some projects)</p>
<p>At the time of this writing, <a href="http://www.oracle.com/us/corporate/press/1957557" title="Oracle Press Release Java EE 7" target="_blank">Java EE 7</a> is already released and the current version of <a href="http://projects.spring.io/spring-framework/" title="Spring Framework" target="_blank">Spring Framework is 4.0.6</a>. Not mentioning that Java 8<a href="http://www.oracle.com/us/corporate/press/2172618" title="Oracle Announces Java 8" target="_blank"></a> is now with us.</p>
<p>Thus, he wants to get up to date for improving the way he writes code that will be profitable for the company he works for.</p>
<p>I appreciate his request, because I&#8217;ll have to review what I really know.</p>
<p>Well. Enough introduction. In coming posts I will write about my particular thoughts of what you can do to know Java a little better.</p>
<p>Next, a summary of the topics that I want to talk about:</p>
<h4>Suggested topics</h4>
<ul>
<li><a href="http://www.oracle.com/technetwork/java/javase/overview/index.html" title="Java SE at a Glance" target="_blank">Java SE</a></li>
<p>The Java EE platform is built on top of the Java SE platform. The Java EE platform provides a particular API for server programming. So,it&#8217;s very reasonable to have a good knowledge of Java SE.</p>
<p>In particular, I assume that you have basic knowledge of Java.</p>
<p>But if you want to improve, you need to know the new features that have been published during the last years:</p>
<ul>
<li><a href="http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#lang" title="New Features and Enhancements J2SE 5.0" target="_blank">Java 5</a></li>
<p><a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/generics.html" title="Generics" target="_blank">Generics</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html" title="The For-Each Loop" target="_blank">enhanced loops</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/autoboxing.html" title="Autoboxing" target="_blank">autoboxing</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/enums.html" title="Enums" target="_blank">enums</a> (I love them), <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/varargs.html" title="Varargs" target="_blank">varargs</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html" title="Static Import" target="_blank">static import</a>, and maybe the most important: <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/annotations.html" title="Annotations" target="_blank">annotations</a> (they change our life as Java developers)</p>
<li><a href="http://www.oracle.com/technetwork/java/javase/features-141434.html" title="Highlights of Technology Changes in Java SE 6" target="_blank">Java 6</a></li>
<p><a href="http://www.onjava.com/pub/a/onjava/2006/08/02/jjdbc-4-enhancements-in-java-se-6.html" title="JDBC 4.0 Enhancements in Java SE 6" target="_blank">JDBC 4.0</a>, Support for the Web Services stack and XML processing, and <a href="http://www.oracle.com/technetwork/articles/javase/beta2-135158.html" title="What's New in Java SE 6" target="_blank">many more</a>. </p>
<li><a href="http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html" title="Java SE 7 Features and Enhancements" target="_blank">Java 7</a></li>
<p>A quite <a href="http://radar.oreilly.com/2011/09/java7-features.html" title="A look at Java 7's new features" target="_blank">handy features for developing</a> like <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html" title="Strings in switch Statements" target="_blank">Strings in switch statements</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/binary-literals.html" title="Binary Literals" target="_blank">Binary integral literals</a> and <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html" title="Underscores in Numeric Literals" target="_blank">underscores in numeric literals</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html" title="Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking" target="_blank">Multi-catch and more precise rethrow</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html" title="Type Inference for Generic Instance Creation" target="_blank">diamond operator</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html" title="The try-with-resources Statement" target="_blank">try-with-resources</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/non-reifiable-varargs.html" title="Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods" target="_blank">Simplified varargs method invocation</a>.</p>
</ul>
<p>As Java 8 has been released very recently, you can skip it for a little while.</p>
<li><a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/" title="Java Concurrency" target="_blank">Java Concurrency</a></li>
<p>Why a specific section for Java SE Concurrency?</p>
<p>Because in Java SE 5 everything changed. Concurrency in Java was improved in a way that provides a more natural approach to multi-threading (I had great joy with two of the enhancement of Java 5: <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/generics.html" title="Java Generics" target="_blank">Generics </a>and <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Callable.html" title="Java Callable" target="_blank">Callable</a>) and at the same time it avoids the long-term errors that the concurrency library had: the method <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop--" title="Java Thread stop" target="_blank">Thread.stop()</a> (actually, it already exists, and <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html" title="Why is Thread.stop deprecated?" target="_blank">I don&#8217;t know why</a>)</p>
<p>Not only you need to try not using Thread.start() anymore, try ExceutorService instead, you also need to know about Future and the new way to synchronize threads for understanding new features for concurrency of Java EE 7.</p>
<p>Besides, it&#8217;s really an improvement to know about <a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html" title="Executors" target="_blank">Executor Framework</a> in Java.</p>
<p>There are a couple of good Java Concurrency tutorials:</p>
<ul>
<li><a href="http://www.vogella.com/tutorials/JavaConcurrency/article.html" title="Vogella's concurrency" target="_blank">Vogella&#8217;s Java concurrency (multi-threading) &#8211; Tutorial</a></li>
<li><a href="http://tutorials.jenkov.com/java-concurrency/index.html" title="Jenkov's Concurrency" target="_blank">Jenkov&#8217;s Java Concurrency / Multithreading Tutorial</a> and <a href="http://tutorials.jenkov.com/java-util-concurrent/index.html" title="Jenkov's concurrency utilities" target="_blank">Java Concurrency Utilities</a></li>
</ul>
<li><a href="http://www.oracle.com/technetwork/java/javaee/overview/index.html" title="Java EE at a Glance" target="_blank">Java EE 7</a></li>
<p>In spite of there are only a few <a href="http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html" title="Java EE Compatibility" target="_blank">Java EE 7 compatible servers</a>, it&#8217;s time to know about the <a href="http://www.infoworld.com/slideshow/105268/11-hot-improvements-java-ee-7-220465" title="11 hot improvements to Java EE 7" target="_blank">exciting new features</a> that will allow you to create better and faster applications:</p>
<ul>
<li>HTML5 (<a href="http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm#GKJIQ5" title="Java API for WebSocket" target="_blank">WebSockets</a> and <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jsonp.htm#GLRBB" title="JSON Processing" target="_blank">JSON</a>)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/partmessaging.htm#GFIRP3" title="Messaging" target="_blank">Simplified JMS 2.0 API</a></li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/batch-processing.htm#GKJIQ6" title="Batch Processing" target="_blank">Batch applications</a></li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities.htm" title="Concurrency Utilities for Java EE" target="_blank">Concurrency utilities</a> (at last <a href="https://jcp.org/en/jsr/detail?id=236" title="JSR 236: Concurrency Utilities for Java EE" target="_blank">JSR 236</a> is finished)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/partcdi.htm#GJBNR" title="Contexts and Dependency Injection for Java EE" target="_blank">Context Dependency Injection</a> (CDI. Yeah, introduced in Java EE 6, it has been enhanced to compete with Spring&#8217;s @Autowired)</li>
<li>Java API for RESTful Web Services (JAX-RS) 2.0 (<a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs.htm#GIEPU" title="RESTful" target="_blank">webservices</a>, <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-client.htm#BABEIGIH" title="Accesing REST" target="_blank">clients</a> and <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-advanced.htm#GJJXE" title="JAX-RS: Advanced Topics and an Example" target="_blank">more</a>)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/servlets.htm#BNAFD" title="Java Servlet TEchnology" target="_blank">Servlet 3.1</a></li>
</ul>
<li><a href="https://spring.io/projects" title="Spring projects" target="_blank">Spring Projects</a></li>
<p>I want to create particular blog entries for each Spring project that I&#8217;ve worked with, but in the meantime, the best way to getting started would be to take a look to the <a href="https://spring.io/guides" title="Spring guides" target="_blank">guides</a> that they provide.</p>
<li>Other technologies good to know</li>
<p>Since you&#8217;re using Java for writing programs to build solutions for business, it&#8217;s good to know the new environments that provides modern approaches for the current challenges.</p>
<p>You have to take a look to <a href="http://en.wikipedia.org/wiki/NoSQL" title="NoSQL from Wikipedia" target="_blank">NoSQL</a>, being <a href="http://www.mongodb.org/" title="mongoDB" target="_blank">MongoDB</a> the most popular, with good <a href="http://docs.mongodb.org/manual/" title="The MongoDB 2.6 Manual" target="_blank">documentation</a>, including <a href="http://docs.mongodb.org/ecosystem/drivers/java/" title="Java MongoDB Driver" target="_blank">programming with Java</a>.</p>
<p>The next step should be <a href="http://en.wikipedia.org/wiki/Big_data" title="Big data from Wikipedia" target="_blank">Big Data</a>. <a href="http://hadoop.apache.org/" title="Apache Hadoop" target="_blank">Hadoop</a> is the project that you have to pay attention for, but it&#8217;s so big, with several related projects, and so complex, that I still haven&#8217;t found a good introductory tutorial.</p>
<p>Finally, <a href="http://en.wikipedia.org/wiki/Asynchronous_I/O" title="Asynchronous I/O from Wikipedia" target="_blank">Asynchronous I/O</a>, that is the new solution for a problem that has been created by the new economy based on the internet of the things, that is, the need of handle scaling transactions from hundreds, thousands, even millions of users and the requirement of high-performance, high-speed for these operations.</p>
<p>There are several new frameworks that are worth it: <a href="http://akka.io/" title="Akka" target="_blank">Akka</a>, <a href="http://malsolo.com/blog4java/?p=35" title="Getting started with Vert.x" target="_blank">Vert.x</a>, <a href="https://github.com/reactor/reactor" title="Reactor" target="_blank">Reactor</a> (<a href="https://spring.io/blog/2013/05/13/reactor-a-foundation-for-asynchronous-applications-on-the-jvm" title="Reactor" target="_blank">a foundational framework</a> for <a href="https://spring.io/blog/2013/07/18/reactor-1-0-0-m1-a-foundation-for-asynchronous-fast-data-applications-on-the-jvm" title="Reactor 1.0.0.M1" target="_blank">asynchronous applications on the JVM</a>, <a href="https://spring.io/blog/2014/05/06/reactor-1-1-0-release-now-available" title="Reactor 1.1.0" target="_blank">by Spring</a>, but it&#8217;s not part of the portfolio) and <a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a> (yes, it&#8217;s JavaScript)</p>
</ul>
<p>That&#8217;s all for now. I hope my colleague finds this entry interesting and I wish it is the first of a series of articles.</p>
<p>Let&#8217;s see.</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=79</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Vert.x</title>
		<link>http://malsolo.com/blog4java/?p=35</link>
		<comments>http://malsolo.com/blog4java/?p=35#comments</comments>
		<pubDate>Tue, 08 Jul 2014 13:29:29 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Asynchronous I/O]]></category>
		<category><![CDATA[Vert.x]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=35</guid>
		<description><![CDATA[What is Vert.x? In my humble opinion, Vert.x is a poorly documented platform for creating server applications intended to be scalable by using an event-driven, non-blocking I/O in the JVM. The first definition for Vert.x I heard was &#8220;it&#8217;s like &#8230; <a href="http://malsolo.com/blog4java/?p=35">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h4>What is Vert.x?</h4>
<p>In my humble opinion, Vert.x is a poorly documented platform for creating server applications intended to be scalable by using an event-driven, non-blocking I/O in the JVM.</p>
<p>The first definition for Vert.x I heard was <em>&#8220;it&#8217;s like Node.js but in the JVM&#8221;</em>. (Yeah!,  part of my first definition has been copied from the description that can be found at <a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a>)</p>
<p>OK! Let&#8217;s take a look to the <a title="Vert.x" href="http://vertx.io/" target="_blank">Vert.x site</a>:</p>
<blockquote><p>&#8220;Vert.x is a lightweight, high performance application platform for the JVM that&#8217;s designed for modern mobile, web, and enterprise applications.&#8221;</p></blockquote>
<p>Terrific! Furthermore:</p>
<ul>
<li>It&#8217;s <strong>polyglot</strong>: you can write your application components in Java, JavaScript, CoffeeScript, Ruby, Python or Groovy. And you can even mix all these languages. Sincerely, I don&#8217;t find this feature exciting.</li>
<li>It has a <strong>simple</strong> APIs for writing non-blocking network enabled applications.</li>
<li>It&#8217;s <strong>scalable</strong> because it uses non blocking I/O to serve many connections with minimal threads plus passing messages to handle the logic of the application.</li>
<li>It provides a simple actor-like <strong>concurrency</strong> model, so that you don&#8217;t have to worry about multi-threaded programming anymore.</li>
</ul>
<p>Well! I still miss something here.</p>
<p>Taking a look to the <strong><em>Key Features</em></strong> you&#8217;ll learn that Vert.x has an <strong>Event Bus</strong>, a kind of Queue that will use the Vert.x components, called <strong>Verticles</strong>, to communicate between them regardless their programming language. It uses WebSockets and SockJS to achieve the JavaScript penetration that they claim.</p>
<p>Vert.x is a platform that you invoke from the command line, <code>vert.x run</code> for single Verticles or <code>vert.x runmod</code> for the encapsulation system that Vert.x provides: the <strong>module system</strong> (that can be shared via <a title="Maven Central Repository" href="http://mvnrepository.com/" target="_blank">Maven repository</a> or <a title="Bintray" href="https://bintray.com/" target="_blank">Bintray</a> and can be registered in the <a title="Vert.x Module Registry" href="http://modulereg.vertx.io/" target="_blank">module registry</a>). But it also can be embedded in a Java application.</p>
<h4>Install Vert.x</h4>
<p>Installing Vert.x is very easy:</p>
<ol>
<li>You need a Linux, OS X or Windows with JDK 1.7.0 or later installed (try <code>javac -version</code> in order to ensure that you have the JDK bin directory on your <code>PATH</code>).</li>
<li>Download the latest release of Vert.x, <a title="Vert.x Downloads" href="http://vertx.io/downloads.html" target="_blank">2.1.1 at the time of this writing</a>.</li>
<li>Decompress the download file. I like to have an Applications directory in my home directory, so: <code>tar -zxf ~/Applications/vert.x-2.1.1.tar.gz</code> will work right.</li>
<li>Add the Vert.x bin directory to your PATH environment variable.</li>
</ol>
<p>Now you can check the version:</p><pre class="crayon-plain-tag">$ vertx version
2.1.1 (built 2014-06-18 14:11:03)</pre><p></p>
<h4>The first example</h4>
<p>Testing the install is as easy as write a simple web server. This example will show the main features of Vert.x: simplicity, scalability, concurrency. With a few more examples, the polyglot would be showed as well.</p>
<p>Copy the following into a text editor and save it as <strong>Server.java</strong></p><pre class="crayon-plain-tag">public class Main {
import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.platform.Verticle;

public class Server extends Verticle {

  public void start() {
    vertx.createHttpServer().requestHandler(new Handler&lt;HttpServerRequest&gt;() {
      public void handle(HttpServerRequest req) {
        //String file = req.path().equals(&quot;/&quot;) ? &quot;index.html&quot; : req.path();
        //req.response().sendFile(&quot;webroot/&quot; + file);
        req.response().end(&quot;Hello World!&quot;);
      }
    }).listen(8080);
  }
}</pre><p>Now run this Verticle (more on the Vert.x concepts later) by opening a console in the directory where you saved the file, and typing:</p><pre class="crayon-plain-tag">~/Documents/vert.x$ vertx run Server.java
Succeeded in deploying verticle</pre><p>To ensure that you have really succeeded with this verticle, open a web browser and go to http://localhost:8080 (see above the highlighted line 15, if you want to change the port number)</p>
<p>You have to see &#8220;Hello World!&#8221; (without the quotes)</p>
<div id="attachment_68" style="width: 310px" class="wp-caption alignnone"><a href="http://malsolo.com/blog4java/wp-content/uploads/2014/07/vertxhello.png"><img class="size-medium wp-image-68" src="http://malsolo.com/blog4java/wp-content/uploads/2014/07/vertxhello-300x141.png" alt="Hello world from Vert.x" width="300" height="141" /></a><p class="wp-caption-text">Hello vert.x</p></div>
<p>Now you can stop the server by using Ctrl+C (Command-C in OS X)</p><pre class="crayon-plain-tag">^C
~/Documents/vert.x$</pre><p></p>
<p>Regarding polyglot, you can find more or less the same sample at <a href="http://vertx.io/" title="Vert.x site" target="_blank"></a> in <a href="http://vertx.io/#ws_js" title="JavaScript" target="_blank">JavaScript</a>, <a href="http://vertx.io/#ws_ruby" title="Ruby" target="_blank">Ruby</a>, <a href="http://vertx.io/#ws_groovy" title="Groovy" target="_blank">Groovy</a>, <a href="http://vertx.io/#ws_python" title="Python" target="_blank">Python</a> and <a href="http://vertx.io/#ws_clojure" title="Clojure" target="_blank">Clojure</a></p>
<p>You can see with this example another feature of Vert.x: you don’t need to compile Java code. I suppose that the authors wanted to give the same facilities that the other languages have, but they are script languages. I don’t find interesting this option, and it’s totally useless for big projects, that is better to be distributed as modules.</p>
<h4>Next steps</h4>
<p>We have seen almost nothing of Vert.x but the installation and a dumb test. In later posts, I will explain the Core Concepts and I will develop a Java Vert.x application using maven.</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=35</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website updated: at last</title>
		<link>http://malsolo.com/blog4java/?p=30</link>
		<comments>http://malsolo.com/blog4java/?p=30#comments</comments>
		<pubDate>Mon, 07 Jul 2014 12:52:12 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Grunt]]></category>
		<category><![CDATA[Javier]]></category>
		<category><![CDATA[Node.js]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Yeoman]]></category>

		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=30</guid>
		<description><![CDATA[I always wanted to have my own website but I don&#8217;t have enough skills as web developer to create one from scratch. I&#8217;m a Java EE developer, so I have to work with HTML/CSS/JavaScript/JQuery on a regular basis. But I&#8217;m &#8230; <a href="http://malsolo.com/blog4java/?p=30">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I always wanted to have my own website but I don&#8217;t have enough skills as web developer to create one from scratch.</p>
<p>I&#8217;m a Java EE developer, so I have to work with HTML/CSS/JavaScript/JQuery on a regular basis. But I&#8217;m not a web designer. Actually, I&#8217;m really bad at designing.</p>
<p>But I love programming and one day I discovered <a href="http://yeoman.io/" title="Yeoman" target="_blank">Yeoman</a> (the web&#8217;s scaffolding tool for modern webapps, as they claim)</p>
<p>The problem here is the usual when you discover a new tool, suddenly you need to know a lot of related stuff. That is, <a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a>, <a href="https://www.npmjs.org/" title="NPM" target="_blank">NPM</a>, <a href="http://gruntjs.com/" title="Grunt" target="_blank">Grunt</a>, <a href="http://bower.io/" title="Bower" target="_blank">Bower</a>, and a lot of intimidating names.</p>
<p>Youtube to the rescue. Find this video <a href="https://www.youtube.com/watch?v=gKiaLSJW5xI" title="&quot;Yeoman tutorial - Master Front-End Workflow with Yeomaman, Grunt and Bower&quot;" target="_blank">&#8220;Yeoman tutorial &#8211; Master Front-End Workflow with Yeomaman, Grunt and Bower&#8221;</a> and you will have your website up and running in a few minutes.</p>
<p>That&#8217;s not totally true. I&#8217;ve had to download <a href="https://www.npmjs.org/package/jpegtran-bin" title="jpegtran-bin" target="_blank">jpegtran-bin</a> and I&#8217;ve spent a lot of time with minor details with some layouts.</p>
<p>Well, it&#8217;s been funny to work as web developer by editing my HTML files, testing them locally (with the server created by <strong><em>grunt server</em></strong>) and then uploading the files to the server (after creating a minified site with <strong><em>grunt build</em></strong>)</p>
<p>And here it is: <a href="http://malsolo.com" title="Malsolo website" target="_blank">Malsolo website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
