Samstag, 16. Januar 2010

Painting by Hand with Bamboo

I played around with BAMBOO, I tryed to draw a class diagram by hand. The idea to have a alternative to a Flip Chart in a meeting or workshop. But I think drawing on paper is much faster :-( ...

Here my first drawing with ArtRage (Demo Version) and Bamboo:

Do not Paint Work with Textual DSL instead

A better option can be to use a DSL instead of hand drawing stuff, e.g. in a brainstorming meeting. Here a example DSL for the picture bellow made with yUML:

[Seller]+1-0..*[Position]
[Sale]+->1..*[Position]
[Position]->1[PositionKey]

[Seller Repository]->[Seller]
[Position Repository]->[Position]
[Sale Service]->[Sale]

[Basar Kasse Service]->[Seller Repository]
[Basar Kasse Service]->[Position Repository]
[Basar Kasse Service]->[Sale Service]

And here the diagramm made by yUML from the DSL:


But I will work on my drawing skills, with BAMBOO, so maybe it will be come a alternative for me to get things fast on a screen ...

Links:
- yUML - http://yuml.me
- ArtRage - http://www.artrage.com/
- BAMBOO - http://www.wacom.eu/

Dienstag, 5. Januar 2010

Eclipse - PDE Incubator Dependency Visualization Plugin

The PDE „Dependency Visualization“ plugin for eclipse is a very cool plugin to get a overview of the dependencies of a OSGi application.  I think the plugin give a much clearer overview of the direct and indirect dependencies of an OSGi bundle then the old tree based PDE plugin does.

Example: Old PDE Dependency Plugin Tree Based:


Example: New PDE Dependency Visualization Plugin - Dependencies as Visualization:



Here the project website of the PDE Incubator Dependency Visualization plugin.

Eclipse - 3D Software Visualization

Codstruction is a 3D software visualization tool more information on the project website.

Screenshot - Eclipse Equinox DS Implementation:

Montag, 4. Januar 2010

Eclipse - Software Visualization

XRay is a nice eclipse plugin which does software visualization. It is not free for commerical use see the XRay page for more details.

Example: Package Dependency of eclipse equinox ds implementation


Example: Class Dependency of eclipse equinox ds implementation

For more information about software visualization in general have a look at the SE-Radio episode 130: Code Visualization with Michele Lanza.

Samstag, 2. Januar 2010

Example - JMockContext - JUnit 4.7 Rule Support

JMock now contains in the SVN trunk (http://svn.codehaus.org/jmock/trunk/jmock2) a class org.jmock.integration.junit4.JMockContext, the class is a JUnit 4.7 rule. With this new JUnit rule for JMock no JUnit runner is needed to use JMock in JUnit tests.

Here a small example test which use the new JMockContext rule:
import java.util.Observer;

import org.jmock.Expectations;
import org.jmock.auto.Mock;
import org.jmock.integration.junit4.JMockContext;
import org.junit.Rule;
import org.junit.Test;

// JUH @RunWith is not needed 
public class ExampleJMockContextTest {
    
    @Rule public JMockContext context = new JMockContext();
    
    @Mock Observer mockObserver;
    
    @Test public void expectNoException(){
        context.checking(new Expectations(){{
            oneOf(mockObserver).update(null, null);
        }});
        
        mockObserver.update(null, null);
    }
    
    @Test(expected=RuntimeException.class)  
    public void expectExceptionInSUT() throws Exception {
        
        context.checking(new Expectations(){{
            oneOf(mockObserver).update(null, null);
        }});
        
        mockObserver.update(null, null);
        
        throw new RuntimeException("Exception in SUT");
    }
    
    @Test(expected=RuntimeException.class) 
    public void expectExceptionInMockObjectTest(){
        
        context.checking(new Expectations(){{
            oneOf(mockObserver).update(null, null);
            will(throwException(new RuntimeException("Observer unavailable")));
        }});
        
        mockObserver.update(null, null);
    }
    
}