<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Mitarbeiter Blog</title>
		<link>http://www.tegonal.com/mitarbeiter-blog/</link>
		<atom:link href="http://www.tegonal.com/mitarbeiter-blog/" rel="self" type="application/rss+xml" />
		<description></description>

		
		<item>
			<title>Galettes &amp; Crêpes</title>
			<link>http://www.tegonal.com/galettes-crepes/</link>
			<description>&lt;p&gt;Am Donnerstag, 2 Februar 2012 führten wir zum 4. Mal unser Apéro für Kunden, Partner und Freunde durch. Wie in jedem Jahr haben wir uns eine kleine kulinarische Überraschung überlegt. Nach Raclette, einem winterlichen Grill und Chili con carne haben wir uns in diesem Jahr für Galettes und Grêpes entschieden.&lt;/p&gt;
&lt;p&gt;Wikipedia sagt zu den beiden Varianten folgenes:&lt;/p&gt;
&lt;pre&gt;Eine Galette (Bretonisch &lt;em&gt;Krampouezhenn&lt;/em&gt;) ist ein &lt;br/&gt;aus der Bretagne stammender Pfannkuchen. &lt;br/&gt;Sie ist die herzhafte Variante der im deutschen &lt;br/&gt;Sprachraum bekannteren Crêpe. &lt;br/&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/Galette&quot; target=&quot;_blank&quot;&gt;Quelle&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;In der Bretagne werden Crêpes grundsätzlich süß &lt;br/&gt;belegt, beispielsweise mit Zucker, Konfitüre, &lt;br/&gt;frischen Früchten oder Nuss-Nougat-Creme.&lt;br/&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&quot;http://de.wikipedia.org/wiki/Crepes&quot; target=&quot;_blank&quot;&gt;Quelle&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Wir hoffen natürlich, dass die von uns angebotenen Varianten der beiden geschmeckt haben. Die meisten haben sicher zu Hause schon Crêpes gemacht. Wir möchten hier noch das Rezept für den dunklen Teig für die Galettes mit euch teilen. Vielleicht hat die eine oder der andere ja Lust bei Gelegenheit dieses zu Hause zuzubereiten.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;200 g Buchweizenmehl (erhältlich im Reformhaus) &lt;/li&gt;
&lt;li&gt;100 g Weissmehl &lt;/li&gt;
&lt;li&gt; 3 Eier &lt;/li&gt;
&lt;li&gt; 450 ml Milch&lt;/li&gt;
&lt;li&gt;40 g geschmolzene Butter&lt;/li&gt;
&lt;li&gt; Salz &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Die Zutaten sollten in der oben stehenden Reihenfolge beigefühgt und der so entstehende Teig am Besten von Hand mit einem Schwingbesen zu einer gleichmässigen, rel. flüssigen Masse verarbeitet werden. Vor der Zubereitung sollte er ca. 2h im Kühlschrank ruhen.&lt;/p&gt;
&lt;p&gt;Danach die Galettes portionenweise in der Bratpfanne je Seite 1-2 Minuten ausbacken. Die Galettes können mit allerlei Zutaten gefüllt werden. An unserem Apéro hatten wir folgende angeboten:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Karotten-Rahm - Sauce&lt;/li&gt;
&lt;li&gt;Schinken Käse&lt;/li&gt;
&lt;li&gt;Käse&lt;/li&gt;
&lt;li&gt;Bolognaise - Sauce&lt;/li&gt;
&lt;li&gt;Tomaten-Pesto - Feta - Salat&lt;/li&gt;
&lt;li&gt;Poulet-Curry - Sauce&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Hier sind der Kreativität keine Grenzen gesetzt.&lt;/p&gt;
&lt;p&gt;E Guete!&lt;/p&gt;</description>
			<pubDate>Fri, 03 Feb 2012 12:12:13 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/galettes-crepes/</guid>
		</item>
		
		<item>
			<title>Compile Save UI Binding based on Mockito Part 2</title>
			<link>http://www.tegonal.com/compile-save-ui-binding-based-on-mockito-part-2/</link>
			<description>&lt;p&gt;Remember my &lt;a href=&quot;http://www.tegonal.com/compile-save-ui-binding-based-on-mockito/&quot;&gt;previous blog entry&lt;/a&gt; about creating compile/refactoring save ui binding based on Mockito and BeansBinding?&lt;br/&gt;&lt;br/&gt;Today we'd like to make some improvements to the previous prototype. Mainly we'd like to add support for binding nested properties like&lt;/p&gt;
&lt;pre&gt;obj.getAdress().getStreet();&lt;/pre&gt;
&lt;p&gt;On the other hand we'd like to encapsulate the usage of Mockito into simple a helper class which may be needed in different projects. Therefore we investigated the Mockito implementation to trace the problem of binding nested properties and encapsulated the required parts into an own class called 'ObjectBinder'. The ObjectBinder is defined using generics to create a wrapper of any object. The ObjectBinder may be used with the following method calls to create a BeanProperty based on a real method call to the object classes stub.&lt;/p&gt;
&lt;pre&gt;ObjectBinder&amp;lt;DummyPojo&amp;gt; binder = new ObjectBinder&amp;lt;BeanBindingPrototype2.DummyPojo&amp;gt;(&lt;br/&gt;
            DummyPojo.class);&lt;br/&gt;&lt;br/&gt;binder.getModelTemplate().getName();&lt;br/&gt;
String path = binder.getBeanPropertyPath();&lt;br/&gt;
BeanProperty&amp;lt;DummyPojo, String&amp;gt; name = BeanProperty.create(path);&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;Using the so called ModelTemplate of the ObjectBinder creates a new Mock-Object of the provided class and starts the tracking. It is following the method calls to that object.&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre&gt;/**&lt;br/&gt;
 * @return type template used to declare gui bindings&lt;br/&gt;
 */&lt;br/&gt;
public O getModelTemplate() {&lt;br/&gt;
    MockSettingsImpl settings = (MockSettingsImpl)new MockSettingsImpl()&lt;br/&gt;
        .defaultAnswer(new EXReturnsDeepStubs(m_mockingCache));&lt;br/&gt;
    O mock = mockUtil.createMock(m_clazz, settings);&lt;br/&gt;
    mockingProgress.mockingStarted(mock, m_clazz, settings);&lt;br/&gt;
    return mock;&lt;br/&gt;
}&lt;/pre&gt;
&lt;p&gt;We use an own answer to keep track of all nested method called based on that mock. &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;pre&gt;    private static class EXReturnsDeepStubs extends ReturnsDeepStubs {&lt;br/&gt;&lt;br/&gt;        private static final long serialVersionUID = 1880837724076720541L;&lt;br/&gt;&lt;br/&gt;        private final MockingCache m_cache;&lt;br/&gt;
        private Map&amp;lt;Object, Object&amp;gt; m_follower = new HashMap&amp;lt;Object, Object&amp;gt;();&lt;br/&gt;&lt;br/&gt;        public EXReturnsDeepStubs(MockingCache cache) {&lt;br/&gt;
            m_cache = cache;&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        @Override&lt;br/&gt;
        public Object answer(InvocationOnMock invocation) throws Throwable {&lt;br/&gt;
            // Class&amp;lt;?&amp;gt; clz = invocation.getMethod().getReturnType();&lt;br/&gt;
            Object answer = super.answer(invocation);&lt;br/&gt;
            // if (new MockCreationValidator().isTypeMockable(clz)) {&lt;br/&gt;
            // return will be another mock&lt;br/&gt;
            Object mock = invocation.getMock();&lt;br/&gt;
            Object parent = m_follower.get(mock);&lt;br/&gt;
            if (parent != null) {&lt;br/&gt;
                m_cache.registerInvocation(parent, mock, invocation);&lt;br/&gt;
            }&lt;br/&gt;
            else {&lt;br/&gt;
                m_cache.registerInvocation(mock, invocation);&lt;br/&gt;
            }&lt;br/&gt;&lt;br/&gt;            // register the following mock&lt;br/&gt;
            m_follower.put(answer, mock);&lt;br/&gt;
            // }&lt;br/&gt;&lt;br/&gt;            return answer;&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;That is where we register every method invocation in a shared cache object instance:&lt;/p&gt;
&lt;pre&gt;    public static class MockingCache {&lt;br/&gt;&lt;br/&gt;        public HashMap&amp;lt;Object, Stack&amp;lt;InvocationOnMock&amp;gt;&amp;gt; m_invocationCache = new HashMap&amp;lt;Object, Stack&amp;lt;InvocationOnMock&amp;gt;&amp;gt;();&lt;br/&gt;&lt;br/&gt;        public void registerInvocation(Object mock, InvocationOnMock invocation) {&lt;br/&gt;
            Stack&amp;lt;InvocationOnMock&amp;gt; stack = m_invocationCache.get(mock);&lt;br/&gt;
            if (stack == null) {&lt;br/&gt;
                stack = new Stack&amp;lt;InvocationOnMock&amp;gt;();&lt;br/&gt;
                m_invocationCache.put(mock, stack);&lt;br/&gt;
            }&lt;br/&gt;
            stack.push(invocation);&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public void registerInvocation(Object parent, Object mock, InvocationOnMock invocation) {&lt;br/&gt;
            Stack&amp;lt;InvocationOnMock&amp;gt; stack = m_invocationCache.get(parent);&lt;br/&gt;
            if (stack == null) {&lt;br/&gt;
                stack = new Stack&amp;lt;InvocationOnMock&amp;gt;();&lt;br/&gt;
            }&lt;br/&gt;
            stack.push(invocation);&lt;br/&gt;
            m_invocationCache.put(mock, stack);&lt;br/&gt;
            m_invocationCache.remove(parent);&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public void clear() {&lt;br/&gt;
            m_invocationCache.clear();&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public Stack&amp;lt;InvocationOnMock&amp;gt; retrieveMockInvocationStack(Object mock) {&lt;br/&gt;
            // m_invocationCache.get(mock);&lt;br/&gt;
            return m_invocationCache.remove(mock);&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;Now the whole trick of getting deep method invocation stack after calling a nested property is fetching the actual stack of the shared cache.&lt;/p&gt;
&lt;pre&gt;public Stack&amp;lt;InvocationOnMock&amp;gt; getLatestInvocationStack() {&lt;br/&gt;
    mockingProgress.stubbingStarted();&lt;br/&gt;
    @SuppressWarnings(&quot;rawtypes&quot;)&lt;br/&gt;
    OngoingStubbing stubbing = (OngoingStubbing)mockingProgress.pullOngoingStubbing();&lt;br/&gt;
    Object mock = stubbing.getMock();&lt;br/&gt;
    stubbing.thenCallRealMethod();&lt;br/&gt;
    return m_mockingCache.retrieveMockInvocationStack(mock);&lt;br/&gt;
}&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;The stack of the method invocation will also get converted into an appropriate BeanProperty using a simple conversion mechanism:&lt;/p&gt;
&lt;pre&gt;    public String getBeanPropertyPath() {&lt;br/&gt;
        // convert stacktrace into bean property&lt;br/&gt;
        Stack&amp;lt;InvocationOnMock&amp;gt; latestInvocationStack = getLatestInvocationStack();&lt;br/&gt;
        StringBuffer buf = new StringBuffer();&lt;br/&gt;
        for (InvocationOnMock invocation : latestInvocationStack) {&lt;br/&gt;
            String methodName = invocation.getMethod().getName();&lt;br/&gt;&lt;br/&gt;            for (String prefix : PREFIXES) {&lt;br/&gt;
                if (methodName.startsWith(prefix)) {&lt;br/&gt;
                    int len = prefix.length();&lt;br/&gt;
                    methodName = String.valueOf(methodName.charAt(len)).toLowerCase()&lt;br/&gt;
                            + methodName.substring(len + 1);&lt;br/&gt;
                    break;&lt;br/&gt;
                }&lt;br/&gt;
            }&lt;br/&gt;&lt;br/&gt;            if (buf.length() &amp;gt; 0) {&lt;br/&gt;
                buf.append('.');&lt;br/&gt;
            }&lt;br/&gt;
            buf.append(methodName);&lt;br/&gt;
        }&lt;br/&gt;
        return buf.toString();&lt;br/&gt;
    }&lt;br/&gt;&lt;br/&gt;    public &amp;lt;S&amp;gt; BeanProperty&amp;lt;O, S&amp;gt; getBeanProperty() {&lt;br/&gt;
        return BeanProperty.create(getBeanPropertyPath());&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;So now we've got a real BeanProperty of a nested method call using compile save method invocation. This BeanProperty can get used as in the first example binding this property to a property of a swing ui element like:&lt;/p&gt;
&lt;pre&gt;ObjectBinder&amp;lt;DummyPojo&amp;gt; binder = new ObjectBinder&amp;lt;BeanBindingPrototype2.DummyPojo&amp;gt;(&lt;br/&gt;
            DummyPojo.class);&lt;br/&gt;&lt;br/&gt;binder.getModelTemplate().getParent().getStreet();&lt;br/&gt;
String path = binder.getBeanPropertyPath();&lt;br/&gt;
BeanProperty&amp;lt;DummyPojo, String&amp;gt; street = BeanProperty.create(path);&lt;br/&gt;&lt;br/&gt;//bean property refering to swing element&lt;br/&gt;
BeanProperty&amp;lt;JTextField, String&amp;gt; textProperty = BeanProperty.create(&quot;text&quot;);&lt;br/&gt;
JTextField field = new JTextField(20);&lt;br/&gt;&lt;br/&gt;DummyPojo realObject = new DummyPojo();&lt;br/&gt;
ParentPojo parent = new ParentPojo();&lt;br/&gt;
realObject.setParent(parent);&lt;br/&gt;&lt;br/&gt;//binding nested beanproperty of real object to textfield property&lt;br/&gt;
AutoBinding&amp;lt;DummyPojo, String, JTextField, String&amp;gt; binding = Bindings.createAutoBinding(&lt;br/&gt;
    UpdateStrategy.READ_WRITE, realObject, name, field, textProperty);&lt;br/&gt;
binding.bind();&lt;/pre&gt;
&lt;p&gt;That's all. The drawbacks of this solution is still that we have to do a method call of the mocked template before fetching a bean property of the ObjectBinder. That means two sequential method call which are required in this order otherwise the mockito framework (clearly) will raise an exception.&lt;br/&gt;&lt;br/&gt;In the next prototype I'd like to create a simple example of a base ui class that may be used to encapsulate the binding logic and provide a simple an easy interface to extending GUI classes.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.tegonal.com/assets/BeanBindingPrototype2.tar.gz&quot; target=&quot;_blank&quot;&gt;The whole maven project can get downloaded from here.&lt;/a&gt;&lt;/p&gt;</description>
			<pubDate>Wed, 23 Nov 2011 13:09:48 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/compile-save-ui-binding-based-on-mockito-part-2/</guid>
		</item>
		
		<item>
			<title>Compile Save UI Binding based on Mockito</title>
			<link>http://www.tegonal.com/compile-save-ui-binding-based-on-mockito/</link>
			<description>&lt;p&gt;A very technical project on which we are working at the moment consist of refactoring a rich client (direct jdbc-DB access) into a thin-/rich-client connected to a JavaEE service layer. We've got the challenge to introduce a couple of new architectural patterns. One of the challenges is to bind the service model data to the swing based gui elements. Sure, there exists a well known bean-binding &lt;a href=&quot;http://www.tegonal.com/#link1&quot;&gt;[1]&lt;/a&gt; project hosted on jgoodies &lt;a href=&quot;http://www.tegonal.com/#link2&quot;&gt;[2]&lt;/a&gt; to automatically bind two properties of different objects against each other. This would look like this:&lt;/p&gt;
&lt;pre&gt;Property propertyVolume = BeanProperty.create(&quot;volume&quot;);&lt;br/&gt;
Property propertySliderValue = BeanProperty.create(&quot;value&quot;);&lt;br/&gt;
Binding bindingVolumeSlider = Bindings.createAutoBinding(&lt;br/&gt;
    AutoBinding.UpdateStrategy.READ_WRITE, &lt;br/&gt;
        volume, propertyVolume,&lt;br/&gt;
    sliderVolume, propertySliderValue);&lt;br/&gt;
bindingVolumeSlider.bind();&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;The Problem of binding those properties against each other is the fact, that the binding is based on property names defined by strings. Refactoring of model classes won't affect those property definitions. The risk in refactoring is therefore very high because errors will occur only at runtime by accessing such a property or by automated tests calling those properties as well. On the other hand there don't exist any code references to those properties used anywhere in the code.&lt;br/&gt;&lt;br/&gt;Therefore we pursued an architectural goal of integrating a compile save bean binding into our new client application. After some coffee and some brain power the idea came up to use parts of the testing framework Mockito &lt;a href=&quot;http://www.tegonal.com/#link3&quot;&gt;[3]&lt;/a&gt; which itself provides the functionality of creating mock based unit tests using compile save statements like&lt;/p&gt;
&lt;pre&gt; LinkedList mockedList = mock(LinkedList.class);&lt;br/&gt;
 &lt;br/&gt;
 //stubbing&lt;br/&gt;
 when(mockedList.get(0)).thenReturn(&quot;first&quot;);&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;Where the methodcall 'get' reflects the real method call of a provided class object.&lt;br/&gt;&lt;br/&gt;Starting with this idea we developed the following prototype showing a simple way to integrate compile/refactoring save UI binding using the two frameworks JGoodies Binding and Mockito.&lt;br/&gt;&lt;br/&gt;We start by creating two dummy objects only used to bind UI elements to some properties of them:&lt;/p&gt;
&lt;pre&gt;    public class DummyPojo {&lt;br/&gt;&lt;br/&gt;        private String m_name;&lt;br/&gt;
        private int m_number;&lt;br/&gt;&lt;br/&gt;        public String getName() {&lt;br/&gt;
            return m_name;&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public void setName(String name) {&lt;br/&gt;
            m_name = name;&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public int getNumber() {&lt;br/&gt;
            return m_number;&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public void setNumber(int number) {&lt;br/&gt;
            m_number = number;&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;br/&gt;&lt;br/&gt;    public static class DummyPojo2 {&lt;br/&gt;&lt;br/&gt;        private String m_street;&lt;br/&gt;&lt;br/&gt;        public String getStreet() {&lt;br/&gt;
            return m_street;&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        public void setStreet(String street) {&lt;br/&gt;
            m_street = street;&lt;br/&gt;
        }&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;Now we created a simple example which binds properties of those two objects to two different swing elements. Any modifications done to the swing components will be propagated to the objects thanks to the JGoodies Binding framework.&lt;/p&gt;
&lt;pre&gt;public BeanBindingPrototype() {&lt;br/&gt;&lt;br/&gt;        DummyPojo spy = Mockito.mock(DummyPojo.class);&lt;br/&gt;
        DummyPojo2 mock2 = Mockito.mock(DummyPojo2.class);&lt;br/&gt;
        BeanProperty&amp;lt;DummyPojo, String&amp;gt; prop = registerPojoProperty(spy.getName());&lt;br/&gt;
        BeanProperty&amp;lt;DummyPojo2, String&amp;gt; prop2 = registerPojoProperty(mock2.getStreet());&lt;br/&gt;&lt;br/&gt;        JFrame frame = new JFrame();&lt;br/&gt;&lt;br/&gt;        JPanel panel = new JPanel();&lt;br/&gt;
        panel.setLayout(new GridLayout(2, 2));&lt;br/&gt;&lt;br/&gt;        JTextField field = new JTextField(20);&lt;br/&gt;
        BeanProperty&amp;lt;JTextField, String&amp;gt; textProperty = BeanProperty.create(&quot;text&quot;);&lt;br/&gt;
        panel.add(new JLabel(&quot;Name:&quot;));&lt;br/&gt;
        panel.add(field);&lt;br/&gt;&lt;br/&gt;        JTextField field2 = new JTextField(20);&lt;br/&gt;
        panel.add(new JLabel(&quot;Street:&quot;));&lt;br/&gt;
        panel.add(field2);&lt;br/&gt;&lt;br/&gt;        frame.getContentPane().add(panel);&lt;br/&gt;&lt;br/&gt;        final DummyPojo realObject = new DummyPojo();&lt;br/&gt;
        final DummyPojo2 realObject2 = new DummyPojo2();&lt;br/&gt;&lt;br/&gt;        AutoBinding&amp;lt;DummyPojo, String, JTextField, String&amp;gt; binding = Bindings.createAutoBinding(&lt;br/&gt;
            UpdateStrategy.READ_WRITE, null, prop, field, textProperty);&lt;br/&gt;
        binding.bind();&lt;br/&gt;
        binding.unbind();&lt;br/&gt;
        binding.setSourceObject(realObject);&lt;br/&gt;
        binding.bind();&lt;br/&gt;&lt;br/&gt;        AutoBinding&amp;lt;DummyPojo2, String, JTextField, String&amp;gt; binding2 = Bindings.createAutoBinding(&lt;br/&gt;
            UpdateStrategy.READ_WRITE, realObject2, prop2, field2, textProperty);&lt;br/&gt;
        binding2.bind();&lt;br/&gt;&lt;br/&gt;        frame.pack();&lt;br/&gt;
        frame.setPreferredSize(new Dimension(200, 200));&lt;br/&gt;
        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);&lt;br/&gt;
        frame.addWindowListener(new WindowAdapter() {&lt;br/&gt;
            @Override&lt;br/&gt;
            public void windowClosing(WindowEvent e) {&lt;br/&gt;
                System.out.println(&quot;Name:&quot; + realObject.getName());&lt;br/&gt;
                System.out.println(&quot;Street:&quot; + realObject2.getStreet());&lt;br/&gt;
            }&lt;br/&gt;
        });&lt;br/&gt;
        frame.setVisible(true);&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;&lt;br/&gt;The interesting part of this idea is the following:&lt;/p&gt;
&lt;pre&gt;DummyPojo spy = Mockito.mock(DummyPojo.class);&lt;br/&gt;
DummyPojo2 mock2 = Mockito.mock(DummyPojo2.class);&lt;br/&gt;
BeanProperty&amp;lt;DummyPojo, String&amp;gt; prop = registerPojoProperty(spy.getName());&lt;br/&gt;
BeanProperty&amp;lt;DummyPojo2, String&amp;gt; prop2 = registerPojoProperty(mock2.getStreet());&lt;/pre&gt;
&lt;p&gt;We create BeanProperties of the two object class properties 'name' and 'street' while referencing a real getter access method.&lt;/p&gt;
&lt;p&gt;Those properties are created using Mockito:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;pre&gt;public &amp;lt;T, S, V&amp;gt; BeanProperty&amp;lt;S, V&amp;gt; registerPojoProperty(T methodCall) {&lt;br/&gt;
        OngoingStubbingImpl&amp;lt;T&amp;gt; stub = (OngoingStubbingImpl&amp;lt;T&amp;gt;)Mockito.when(methodCall);&lt;br/&gt;
        List&amp;lt;Invocation&amp;gt; registeredInvocations = stub.getRegisteredInvocations();&lt;br/&gt;
        Invocation invocation = registeredInvocations.get(0);&lt;br/&gt;
        String methodName = invocation.getMethodName();&lt;br/&gt;
        for (String prefix : prefixes) {&lt;br/&gt;
            if (methodName.startsWith(prefix)) {&lt;br/&gt;
                int len = prefix.length();&lt;br/&gt;
                methodName = String.valueOf(methodName.charAt(len)).toLowerCase()&lt;br/&gt;
                        + methodName.substring(len + 1);&lt;br/&gt;
                break;&lt;br/&gt;
            }&lt;br/&gt;
        }&lt;br/&gt;&lt;br/&gt;        BeanProperty&amp;lt;S, V&amp;gt; property = BeanProperty.create(methodName);&lt;br/&gt;&lt;br/&gt;        stub.thenCallRealMethod();&lt;br/&gt;
        return property;&lt;br/&gt;
    }&lt;/pre&gt;
&lt;p&gt;Performing a Mockito 'when' operation we can extract an OngoingStubbing of the effective method called on that mock before. Within this OngoingStubbing we get all informations needed to extract the real methodname called and derived from that we can create dynamically a string based BeanProperty describing this methodcall.&lt;br/&gt;&lt;br/&gt;Drawbacks of this implementations are the missing support for nested object property access like this one:&lt;/p&gt;
&lt;pre&gt; obj.getAdress().getStreet()&lt;/pre&gt;
&lt;p&gt;The solution to this we'd like to solve in the next chapter.&lt;br/&gt;&lt;br/&gt;So far best regards from the tegonal development team.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a name=&quot;link1&quot;&gt; &lt;/a&gt;[1] &lt;a href=&quot;http://today.java.net/pub/a/today/2008/05/27/binding-beans.html)&quot; target=&quot;_blank&quot;&gt;http://today.java.net/pub/a/today/2008/05/27/binding-beans.html)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a name=&quot;link2&quot;&gt; &lt;/a&gt;[2] &lt;a href=&quot;http://www.jgoodies.com/downloads/libraries.html&quot; target=&quot;_blank&quot;&gt;http://www.jgoodies.com/downloads/libraries.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a name=&quot;link3&quot;&gt; &lt;/a&gt;[3] &lt;a href=&quot;http://code.google.com/p/mockito/&quot; target=&quot;_blank&quot;&gt;http://code.google.com/p/mockito/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;a href=&quot;http://www.tegonal.com/assets/BeanBindingPrototype.tar.gz&quot; target=&quot;_blank&quot;&gt;Download maven Project source code of prototype&lt;/a&gt; [tar.gz-File]&lt;/p&gt;</description>
			<pubDate>Fri, 18 Nov 2011 13:24:56 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/compile-save-ui-binding-based-on-mockito/</guid>
		</item>
		
		<item>
			<title>Wiederauferstehung einer GPU - oder der Beweis für die Holzhammer-Methode</title>
			<link>http://www.tegonal.com/ma-blog-rouven-1/</link>
			<description>&lt;p&gt;Mein nettes kleines Dell XPS 1330 hat vor ein paar Wochen den gefürchteten Nvidia-GPU Hitzetod erlitten: Angeblich sind in dieser Serie technisch nicht ganz einwandfreie (hah) Nvidia Chips verbaut worden. Nvidia hatte Rückstellungen in dreistelliger Millionenhöhe gemacht, Dell hat sich aber nicht sonderlich angestrengt, seine Kunden an diesen Millionen teilhaben zu lassen. De Facto ist mein Dell Laptop nach der Garantiezeit ausgestiegen und hat sich grafikmässig verabschiedet.&lt;/p&gt;
&lt;p&gt;Nach etwas Recherche bin ich auf dieses interessante &lt;a href=&quot;http://www.youtube.com/watch?v=NJlgPbELL0E&quot; target=&quot;_blank&quot;&gt;Video&lt;/a&gt; (Youtube) gestossen. Nach einer Behandlung mit dem Heissluftföhn (1800 Watt, ca 300 Grad Celcius) zeigt sich beim Starten wieder ein Bild ... tja, manchmal hilft die Holzhammermethode tatsächlich.&lt;/p&gt;</description>
			<pubDate>Thu, 01 Jul 2010 11:37:31 +0200</pubDate>
			
			
			<guid>http://www.tegonal.com/ma-blog-rouven-1/</guid>
		</item>
		
		<item>
			<title>Die Tücken einer Webcam (2/2)</title>
			<link>http://www.tegonal.com/ma-blog-alwin-3/</link>
			<description>&lt;p&gt;(Wie wir die Idee einer Webcam mit unsere Büro-Aussicht angegangen  sind, im &lt;a href=&quot;http://www.tegonal.com/../../ma-blog-alwin-2/&quot;&gt;ersten Teil des Artikels&lt;/a&gt;.)&lt;/p&gt;
&lt;p&gt;Lange mussten wir nicht warten. Der Tag war wohl ereignislos und die  Online-Presse hat die Bärencam gleich wohlwollend in kurzen Artikeln  erwähnt.&lt;/p&gt;
&lt;h3&gt;Warteschlangen&lt;/h3&gt;
&lt;p&gt;Die Besucher blieben auch nicht lange aus und schon nach kurzer Zeit  musste man eine Stunde, manchmal zwei Stunden warten um die Kamera  bedienen zu dürfen.&lt;/p&gt;
&lt;p&gt;Das war natürlich nicht praktikabel. Wir entschieden uns in der Folge  eine andere Art der Steuerung umzusetzen: Die Community sollte die  Kamera gemeinschaftlich steuern. Alle 6 Sekunden wird ein Kommando  abgesetzt. Es wird jeweils jenes gewählt, welches am meisten Stimmen  erhält. Dies hat sich schnell als optimal heraus gestellt.&lt;/p&gt;
&lt;h3&gt;Datenschutz&lt;/h3&gt;
&lt;p&gt;Die Bärencam lief nun einige Tage und mussten wir wieder eingreifen.  Die Bärencam, ein Nebenbei-Projekt, hatte nun schon mehr Aufwand  generiert als erwartet. Nun wurden wir auf die Datenschutz-Problematik  hingewiesen. Zugegeben, wir hatten uns nicht vertieft mit dem Thema  auseinandergesetzt. Im Leitfaden &lt;a href=&quot;http://www.tegonal.com/../../ma-blog-alwin-2/#http://www.edoeb.admin.ch/themen/00567/00569/index.html?lang=de&quot; target=&quot;_blank&quot;&gt;&quot;Datenschutzkonformer Betrieb von Webcams&quot;&lt;/a&gt; des  Eidgenössischen Datenschutz- und Öffentlichkeitsbeauftragten steht u.a.  folgendes:&lt;/p&gt;
&lt;blockquote&gt;Falls es jedoch möglich ist, Personen zu bestimmen, liegt  ein Bearbeiten von Personendaten im Sinne von Art. 3 lit. e DSG vor.  Bestimmbar ist eine Person auch dann, wenn sie zwar durch ihre Daten  nicht eindeutig identifiziert wird, aus den Umständen, das heisst aus  dem Kontext einer Information (z.B. Gegenstände, Kleidung, Fahrzeuge  etc.) aber auf sie geschlossen werden kann.&lt;/blockquote&gt;
&lt;p&gt;Auf der Bärencam kann man Personen sehen. Die Auflösung der Kamera  ist zwar schlecht und Gesichter sind kaum zu erkennen, Kleidung aber  schon. Daher ist die Kamera nicht Datenschutz konform. Ein kurzer Blick  auf die Webcams in der Schweiz ergibt, dass viele die oben genannten  Bedingungen nicht erfüllen.&lt;/p&gt;
&lt;p&gt;Wir lösen das Problem mit einer Folie, welche wir vor das Fenster  kleben, so dass das Blickfeld der Kamera nur noch auf das Innere des  Bärenparks fällt.&lt;/p&gt;
&lt;h3&gt;Zusätzliche Erweiterungen&lt;/h3&gt;
&lt;p&gt;Haben wir Zeit, werden wir auch in Zukunft kleine Erweiterungen für  die Bärencam umsetzen. Dies könnten sein:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p style=&quot;margin-bottom: 0cm;&quot;&gt;Eine  Möglichkeit Schnappschüsse 	zu vermailen&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style=&quot;margin-bottom: 0cm;&quot;&gt;Schnappschüsse  in einer Galerie 	aufnehmen&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Die Bären mittels Bildanalyse automatisch finden und tracken&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Übrigens:&lt;/p&gt;
&lt;p&gt;Wir geben den Code für den Camproxy übrigens gerne unter der GPL  weiter. Falls Interesse besteht, dann nehmt bitte mit uns Kontakt auf.&lt;/p&gt;</description>
			<pubDate>Wed, 24 Mar 2010 10:00:00 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/ma-blog-alwin-3/</guid>
		</item>
		
		<item>
			<title>Die Tücken einer Webcam (1/2)</title>
			<link>http://www.tegonal.com/ma-blog-alwin-2/</link>
			<description>&lt;p&gt;Die Idee eine Webcam zu installieren und den Ausblick aus unserem  Büro mit den Internetbenutzern zu teilen hatten wir schon länger. Mit  der Eröffnung des Bärenparks auf der gegenüberliegenden Aareseite hat  sich die Idee konkretisiert und wir haben uns daran gemacht die Idee  umzusetzen. Von Anfang an war klar, dass das Vorgehen &quot;kaufen,  anschrauben, laufen lassen&quot; nicht wird möglich sein. Die Problemstellung  war die folgende:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p style=&quot;margin-bottom: 0cm;&quot;&gt;Die  Webcam würde an unser Netz 	hier in der Bürogemeinschaft angeschlossen.  Dies darf nicht zu 	stark belastet werden. Die Last darf daher nicht  proportional mit 	den Nutzern der Webcam steigen.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p style=&quot;margin-bottom: 0cm;&quot;&gt;Webcams  verfügen im Allgemeinen 	über ein hässliches UI zur Bedienung. Wir  möchten aber eine 	hübsche Webseite anbieten.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Die Kamera soll gesteuert werden können. Sind viele Leute 	 gleichzeitig online, muss hier eine Lösung gefunden werden.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Als Kamera haben wir uns für die WCS-2040 von level1 entschieden  welche ein gutes Preis/Leistung Verhältnis hat für ein Tilt/Shift/Zoom  (T/S/Z) Modell. Der Bärenpark sollte ja von nah sichtbar sein, also  musste ein Zoom möglich sein..&lt;/p&gt;
&lt;p&gt;Diese oben stehenden Punkte haben wir gelöst in dem wir einen  Kamera-Proxy entwickelt haben. Diese Applikation läuft als &lt;a href=&quot;http://www.tegonal.com/#http://www.baerepark.ch&quot; target=&quot;_blank&quot;&gt;www.bärepark.ch&lt;/a&gt; auf einem unserer Server im Puzzle-Rack im Sunrise Rechenzentrum. Der  Proxy lädt alle ca. 2 Sekunden das aktuelle Bild von der Kamera,  verteilt dieses an alle Webseiten und setzt allfällige Steuerkommandos  zuhanden der Kamera ab. Zudem führt die App einige Batch-Jobs durch. Die  Übersichtsbilder werden alle 10 Minuten neu geladen sowie kalibriert  und die Kamera wird alle 2 Stunden neu gestartet (sie hat sich im  Dauerbetrieb leider als störanfällig heraus gestellt).&lt;/p&gt;
&lt;p&gt;Das Web-UI haben wir mit &lt;a href=&quot;http://wicket.apache.org/&quot; target=&quot;_blank&quot;&gt;Apache Wicket&lt;/a&gt; umgesetzt. Dieses Web-Framework bietet einige Ajax-Funktionalität, was  für die geplante Umsetzungsvariante unabdingbar war. Wicket ermöglicht  es eine kleinere bis mittlere Web-Applikation in sehr kurzer Zeit  umzusetzen. Die sehr moderne Architektur der Library erleichtert zudem  die Integration von Spring und anderen State-of-the-Art Technologien.&lt;/p&gt;
&lt;p&gt;Daneben setzen wir &lt;a href=&quot;http://www.tegonal.com/#http://www.imagemagick.org&quot; target=&quot;_blank&quot;&gt;ImageMagick&lt;/a&gt; zur Bearbeitung der Bilder ein. Dies beinhaltet das Drehen der Bilder  sowie das Einfügen des Tegonal-Logos als Watermark.&lt;/p&gt;
&lt;p&gt;Um allen BesucherInnen die Steuerung der Kamera zu ermöglichen, haben  wir eine Warteschlange vorgesehen. BesucherInnen können der Reihe nach  60 Sekunden steuern.&lt;/p&gt;
&lt;p&gt;Gut. Funktioniert. Kurz eine Mitteilung an die Presse verfasst und  gewartet.&lt;/p&gt;
&lt;p&gt;(Was dann geschah liest du im &lt;a href=&quot;http://www.tegonal.com/ma-blog-alwin-3/&quot;&gt;zweiten Teil des Artikels&lt;/a&gt;.)&lt;/p&gt;</description>
			<pubDate>Wed, 24 Mar 2010 09:49:00 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/ma-blog-alwin-2/</guid>
		</item>
		
		<item>
			<title>Neue Tegonal Webseite mit Silverstripe CMS</title>
			<link>http://www.tegonal.com/ma-blog-alwin-1/</link>
			<description>&lt;p&gt;Unsere alte, sehr alte Website haben wir damals schnell und  unkompliziert mit PHP und eigenen, sehr rudimentären Templates erstellt.  Den Zwecks hat sie über die Jahre stets erfüllt. Das Erfassen und  Ändern von Inhalten war zwar immer etwas mühsam, aber regelmässig haben  wir den Inhalt der Seite eh nicht verändert. Oder haben wir dies nicht  oft gemacht, gerade weil das Abfüllen umständlich war? Nun gut, auch der  optische Eindruck der Website liess seit längerem zu wünschen übrig,  höchste Zeit also für eine neue, hübsche Website.&lt;/p&gt;
&lt;p&gt;Und natürlich wollten wir bei der Gelegenheit auch gleich ein  zeitgemässes Content Management System (CMS) einführen. Manfred von &lt;a href=&quot;http://www.monkee.ch&quot; target=&quot;_blank&quot;&gt;monkee solutions&lt;/a&gt; hat uns auf &lt;a href=&quot;http://www.silverstripe.org&quot; target=&quot;_blank&quot;&gt;SilverStripe&lt;/a&gt; aufmerksam gemacht. Vielen Dank für den Tipp!&lt;/p&gt;
&lt;p&gt;SilverStripe ist ein PHP/MySQL basiertes CMS und deckt unsere  Bedürfnisse optimal ab ohne riesig und überladen daher zu kommen. Wir  freuen uns nun über ein neues, angenehmes Tool und wir hoffen nun auch  etwas öfter die Inhalte zu verändern und zu ergänzen.&lt;/p&gt;
&lt;p&gt;Unsere Mitarbeiter-Blogs sind ein erster Schritt in diese Richtung.  Diese Blogs sollen ein Gefäss sein um die vielfältigen Erfahrungen die  wir täglich bei unserer Arbeit machen von Zeit zu Zeit in einen  Blog-Eintrag einfliessen zu lassen um auch so der OpenSource-Community  einen kleinen Beitrag zurück zu geben. Mehr dazu aber später...&lt;/p&gt;</description>
			<pubDate>Thu, 14 Jan 2010 15:00:00 +0100</pubDate>
			
			
			<guid>http://www.tegonal.com/ma-blog-alwin-1/</guid>
		</item>
		

	</channel>
</rss>
