Wednesday, April 15, 2015

Agile Architecture by Molly Dishman and Martin Fowler

I'm copying here what Mahmoud Atef mentioned in his post on Linkedin that sums up this video. I think it's really important to follow such tips in order to provide some sort of architecture management during the software development. Here is what Mahmoud wrote:

I was lucky to listen to  "Agile Architecture" talk by Molly Dishman & Martin Fowler (attached @the end of this post). I come up with eight points that I want to share my thoughts about.

  1. Focus on the things that are hard to change and make them changeable. Mainly, service contracts and database design are the most rigid parts in any architecture design. Sometimes it's OK to fix them if the requirements are very clear from the beginning of the project, which is rare to happen. Most of the time, you need to find a way to simplify the change in these parts whenever it is needed.
  2. Architects are more working as team leads and have to get their hands into code. In agile project, architects are almost engaged along the project lifetime. They are required to solve day-to-day technical challenges and come up with solutions to new problems. This couldn't be done unless they have hands on the project code and know its current status and improvements needed.
  3. Architecture is more like city planing with all the dynamics implied rather than a static building structure. Evolutionary design and refactoring are two of the main features in agile projects nowadays. Architects have to believe that their designs will be changed with time and start to think how flexible and tolerant are their designs. They also need to be more willing to experiment things and change if it doesn't work.
  4. The best place of detailed design is in people minds. Detailed design document became part of the history because, simply nobody needs it. If it comes to details, code is the most updated detailed design a programmer can get. Architect has to make sure that there is a common understanding of the application design and how it works.
  5. Highlight example part of the code and let people to understand and copy from. Sample of code is one of the most powerful methods of ensuring common understanding for the design. It also puts programmers on the right track rapidly by copping the sample and put their changes with lowest effort.
  6. Use code analysis tool to keep the code standards followed across the project. You need to have a tool to scan the code base and give you a comprehensive report about the standard violations. This will give you and your team faster and broader vision on the problems you have to tackle.
  7. Keep an eye on the code commits to get an overview of developers performance. It's not enough to use tools to give you report on how code is going on, you need to check some of the project commits to get an overview on how programmers are implementing their stories and how far is the code stream from your design.
  8. Give architects and senior developers time to think about architecture. Time is the key factor for innovation and improvement. If the team is always on rush to deliver and no time to step back and think, they won't have a chance to think about the application which will affect the overall implementation and performance in a very bad way.

Finally, for more videos for Martin Fowler you can check this page.

Sunday, April 12, 2015

Java EE 7 Maven Coordinates

This is a useful link that contains the Maven dependencies for the Java EE platform APIs.

Thursday, April 9, 2015

Adding MyBatis mapper files dynamically

I'm currently working in a project that we needed to implement such case. Assuming you are using MyBatis CDI in a EJB/CDI context, the bellow code will produce the MyBatis SqlSessionFactory for the MyBatis mapper files that are defined in a static way.

First, your Configuration.xml will only contain the database connection as bellow:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-// Config 3.0//EN" "">
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="UNPOOLED">
                <property name="driver" value="oracle.jdbc.driver.OracleDriver"/>
                <property name="url" value="jdbc:oracle:thin:@<HOST>:<PORT>:<DB_NAME>"/>
                <property name="username" value="<SCHEMA>"/>
                <property name="password" value="<PASSWORD>"/>