tag:blogger.com,1999:blog-78338901255518744802024-03-21T15:22:49.476+01:00Frank Hinkel Software Engineering, ArchitectureFrank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-7833890125551874480.post-2317921686968821042013-10-23T14:49:00.000+02:002019-07-19T21:02:50.773+02:00Get Random Documents from MongoDBWhile finalizing my first draft of <b>nodecards</b>, I stumbled on retrieving random documents from MongoDB. <b>Nodecards</b> is a small open source project which I use to try out some new technologies. It is a simple Flashcard application, written in node.js. It is kinda quick'n'dirty coded stuff, so don’t expect clean lines of code, yet.
Because it was not so easy and I am not really sure that I have taken the right way I want to present you my implementation of retrieving random documents from MongoDB.<br />
<br />
<h3>Get random within the range of a collection</h3><br>
To get the random document i just call count() at the collection.
<script class="brush:javascript" type="syntaxhighlighter"><![CDATA[
function findOneRandomCard(result, res){
db.coll.count({function(err, result){...})
};
]]></script>
<br />
After that I used skip() within the find to skip a number of documents. The skip is based on Math.random() and the previous estimated max range. Moreover I added a limit(1) to retrieve just one document. In a nutshell: <i>My way to get random documents is by skipping documents based on a random number and limit the size to one.</i> If you have some better and more efficient ways to do, please let me know.
<br />
<script class="brush:javascript" type="syntaxhighlighter"><![CDATA[
function findOneRandomCard(result, res){
db.coll.count({function(err, result){
db.coll.find(
{"version": "1.0"},
{fielda: 1, fieldb: 1},
{skip: Math.floor((Math.random()*(result-1))), limit: 1},
function(err, results) {
if (results){
//do some stuff
}else {console.log(err);}
}
)
});
};
]]></script>
<br />
<h3>Get random within a custom scope</h3><br>
Furthermore I had the idea to reduce the number on documents by adding a specific user defined condition. I passed in a max value that has been chosen by a user. Based on that max value I count how much elements are in the db.coll.correct array and retrieve only documents where the number of containing elements is lower than the max value.
<script class="brush:javascript" type="syntaxhighlighter"><![CDATA[
function findOneRandomCard(result, res, max){
db.coll.count(
{$where : "this.correct.length < " + max },
function(err, result){
db.coll.find(
{"version": "1.0", $where : "this.correct.length < " + max},
{fielda: 1, fieldb: 1},
{skip: Math.floor((Math.random()*(result-1))), limit: 1},
function(err, results) {
if (results){
//do some stuff
}else {console.log(err);}
}
)
});
};
]]></script>
Cheers,
FrankFrank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com3tag:blogger.com,1999:blog-7833890125551874480.post-17252536631200504622012-11-28T17:07:00.002+01:002012-12-01T10:18:19.804+01:00Java 8 - Closures, Lambda Expressions Demystified<span style="font-size: x-large;">Project Lambda, Closures </span><span style="font-size: x-large;">- JSR 335 (Part 1)</span>
<table><tbody>
<tr><td valign="top">
Lambda Expressions are probably one of the most interesting changes of the Java Language. They will add totaly different syntactical elements like the Arrow Operator, Method References, Defender Methods etc. Java gains functional aspects to reduce verbosity and improve parallel processing and stability.
<br />
<br />
<span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">Why Lambda
</span></span><br />
We all know Java Language is an object oriented programming language and we are using it with passion. But sometimes we want to pass some code to a method instead of an object. To make this happen we are implementing Callbacks. This leads us to develop verbose code and it feels not like to be well supported by Java. An additional use case is dealing with groups of data. Sometimes it is necessary to execute a specific algorithm to a group of data. Functional programming langues support things like "forAllDo". In Java you need to implement that by yourself or have to use some utility classes from third party libraries. This might be verbose and creepy.</td>
<td align="right" valign="top"><table bgcolor="#fAfAfA" cellpadding="5" style="border: 1px dashed #ccc; width: 260px;"><tbody>
<tr><td><span style="font-size: large;">Java 8 Blog Series</span><br />
<hr size="1" />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> <a href="http://frankhinkel.blogspot.de/2012/11/java-8-closures-lambda-expressions.html">1. Closures, Lambda Part 1 - Demystified</a></span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> 2. Closures, Lambda Part 2 - Deep dive</span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> 3. Project Jigsaw</span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> 4. Date and Time API</span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> 5. Annotiations, Checker Framework</span></span><br />
<span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: 9pt;"> 6. Concurrent Collection Framework</span></span></td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: x-large;"><br /></span></span>
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: x-large;">Setting Up Lambda</span></span><br />
Because the development of Java 8 has not finished yet and the IDE Support is in an rudimental state, I recommand following environment set-up:<br />
<br />
<center>
<table bgcolor="#fAfAfA" cellpadding="15" style="border: 1px dashed #ccc; width: 80%;">
<tbody>
<tr><td><span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: large;">Download</span></span><br />
<ul>
<li><a href="http://bertram2.netbeans.org:8080/job/jdk8lambda/lastSuccessfulBuild/artifact/nbbuild/" target="_blank">NetBeans IDE - Latest Nightly Build Version </a></li>
<li><a href="http://jdk8.java.net/lambda/" target="_blank">Java 8 JDK - Latest Snapshot </a></li>
</ul>
</td></tr>
</tbody></table>
</center>
<br />
Proceed following steps to set up your environment and run Java 8:<br />
<ol>
<li>Download NetBeans and Java 8 (use Links above)</li>
<li>Unzip NetBeans and Java 8 JDK</li>
<li>Run NetBeans (with command line param: --jdkhome YourJava8Dir)</li>
<li>Check if your sources compile in java8</li>
</ol>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
At the following I want to give you a short overview what is possible with Closures
and Lambda Expressions. After that I will explain Lambda systematically to show
up what happends behind the scenes.<br />
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: x-large;"><br /></span></span>
<span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">Part 1: Lambda in Action </span></span><br />
<br />
<span style="color: #0b5394;"><span style="font-size: large;">Anonymous Inner Classes</span></span><br />
<br />
<b>Classic approach </b><br />
At the following snippet you can see how we use Anonymous Inner Classes in Java all the time. Adding an ActionListener to an UI Element is an usual use case.
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
package java8;
import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Java8 {
public static void main(String[] args) {
Button myButton = new Button();
myButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
System.out.println(ae.getSource());
}
});
}
}
]]></script>
NetBeans shows a big warning: <i>This anonymouse inner class creation can be turned into a lambda expression.</i> If you press <b>Alt+Enter</b> to fix it, NetBeans will convert the source code into a lambda expression.
<br />
<br />
<b>The Lambda way</b><br />
By using lambda the source code looks like this:
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
package java8;
import java.awt.Button;
import java.awt.event.ActionEvent;
public class Java8 {
public static void main(String[] args) {
Button myButton = new Button();
myButton.addActionListener((ActionEvent ae) -> {
System.out.println(ae.getSource());
});
}
}
]]></script>
Notice that our code is les verbose. Furthermore it is not necessary to import "java.awt.event.ActionListener" any more. Moreover it is possible to get rid of class casting and some verbosity by using type inference:
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
package java8;
import java.awt.Button;
public class Java8 {
public static void main(String[] args) {
Button myButton = new Button();
myButton.addActionListener(
ae -> {System.out.println(ae.getSource());}
);
}
}
]]></script>
The Type of "ae" depends on the context in which it appears (Target Typing). That allows us to delete the import of "java.awt.event.ActionEvent" and we are happy to see a little less dependency. I explain more about the SAM-Types and what happens there later.
<br />
<span style="font-size: x-large;"> <br /></span>
<span style="color: #0b5394;"><span style="font-family: inherit;"><span style="font-size: large;">Method References</span></span></span><br />
<br />
Lambda Expressions provide far more than dealing with anonymous methods. It is possible to adress the invocation of static and non static methods by using "::" operator.
<br />
<br />
<b>Static methods </b>
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
package java8;
import java.util.Arrays;
public class Java8 {
public static int myCompare(String in, String out){
return in.length() - out.length();
}
public static void main(String[] args) {
Arrays.sort(args, Java8::myCompare);
}
}
]]></script>
<br />
<b>Non static methods</b><br />
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
package java8;
import java.util.Arrays;
public class Java8 implements Comparable<java8>{
@Override
public int compareTo(Java8 t) {return ...}
public static void main(String[] args) {
Java8 myObj = new Java8();
Arrays.sort(args, myObj::compareTo);
}
}
]]></script>
Arrays.sort will invoke the compareTo method of myObj because it has the reference of that method.<br />
<span style="font-size: x-large;"> <br /></span>
<span style="color: #0b5394;"><span style="font-family: inherit;"><span style="font-size: large;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: large;">Virtual Exten<span style="font-size: large;">sion Methods</span></span></span></span></span></span><br />
<br />
Extension Methods alias Defender Methods alias Default Methods exists to integrate the new previous introduced features of Java 8 into Java 7 and grant backwards compatibility. All the functional features would have no use if we could not find them as a part of Java langauge core, so there has to be a way to change things like the Collection-Framework but ensure same behavior in legacy code without compile errors. Virtual Extension Methods are highly discussed because of an insane impact to the language. (e. g. interfaces with method bodys)<br />
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
public interface List<e> extends Collection<e> {
...
public void sort(Comparator<? super E> c) default {
Collections.<e>sort(this, c);
}
}
]]></script>
List is an well known interface and it became again an victim of Java language extensions. Besides some confusing abstract wildcard generic types, we can find method bodys within the interface definition. So what tells us the code now? We now have an optional implementation contract between interfaces and classes, like we have in abstract classes with implemented methods. Every implementation of List has the opportunity to overwrite "sort" but it is not obligatory. This is by far the most strange language extension of Java I have seen so far. I understand that such abominations are necessary for compatibility reasons. However I feel bad to see the highest abstraction level becomming a concrete implementation.
<br />
<span style="font-size: x-large;"> <br /></span>
<span style="font-family: inherit;"><span style="font-size: large;"><span style="font-family: Arial,Helvetica,sans-serif;"><span style="font-size: large;"><span style="color: #0b5394;"><span style="font-size: large;">J<span style="font-size: large;">DK integration and improvement</span></span></span></span></span></span></span>
<span style="font-size: x-small;"> <br /></span>
<span style="font-size: x-small;"> <br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ0I7_G1pwdO1OMqhEsRNi6qWKEL9yfZJ9qCFREs1IRbEsG-bsLiKfFcBGh-3DLiKJdAu9s8AVko4FF0wWWF8CY_WPT0g5yYUSQPotXK8JeKGsFZkW3FfhC88t4C7YEX_6_dAXV44wcDw/s1600/functions.PNG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ0I7_G1pwdO1OMqhEsRNi6qWKEL9yfZJ9qCFREs1IRbEsG-bsLiKfFcBGh-3DLiKJdAu9s8AVko4FF0wWWF8CY_WPT0g5yYUSQPotXK8JeKGsFZkW3FfhC88t4C7YEX_6_dAXV44wcDw/s320/functions.PNG" width="167" /></a></div>
JDK improvement starts in "java.util.functions". You can see the current content of the package at the right image. I picked some interesting interfaces that I discuss briefly.
<br />
<br />
<table style="width: 350pxpx;"><tbody>
<tr><td><b>BinaryOperator.class</b> - combines two operands
<script class="brush:java" type="syntaxhighlighter" width="300px"><![CDATA[
Foo one = operator.eval(a,b);
Foo two = operator.eval(a,b);
Foo three = operator.eval(a,operator.eval(b,c));
Foo four = operator.eval(b,operator.eval(a,c));
]]></script>
</td></tr>
</tbody></table>
<table style="width: 350pxpx;"><tbody>
<tr><td><b>Mapper.class</b> - maps from class a to class b (within a chain)
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
Foo x = mapper.map(a);
Foo y = mapper.map(b);
....
public interface Mapper<R, T> {
R map(T t);
public <v> Mapper<V, T> compose(
Mapper<? extends V, ? super R> after
) default {
return Mappers.chain(this, after);
}
}
]]></script>
</td></tr>
</tbody></table>
<table style="width: 350pxpx;"><tbody>
<tr><td><b>Predicate.class</b> - determines if the input object matches some criteria
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
boolean one = predicate.test(a);
boolean two = predicate.test(a);
...
public interface Predicate<t> {
boolean test(T t);
Predicate<t> and(Predicate<? super T> p) default {
return Predicates.and(this, p);
}
Predicate<t> negate() default {
return Predicates.negate(this);
}
Predicate<t> or(Predicate<? super T> p) default {
return Predicates.or(this, p);
}
Predicate<t> xor(Predicate<? super T> p) default {
return Predicates.xor(this, p);
}
}
]]></script>
</td></tr>
</tbody></table>
Besides new packages and classes Lambda Expressions will improve existing code. Probably the collection framework will change a lot. A functional way of handling groups of data could be a big advantage. Less verbose code leads to more stability and functional processing without sideeffects makes parallel processing much easier.
<br />
<br />
<b>Example: Collection.removeAll (with filter)</b>
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
boolean removeAll(Predicate<? super E> filter) default {
Objects.requireNonNull(filter);
boolean removed = false;
Iterator<e> each = iterator();
while(each.hasNext()) {
if(filter.test(each.next())) {
each.remove();
removed = true;
}
}
return removed;
}
]]></script>
<b>Lambda way to use</b>
<script class="brush:java" type="syntaxhighlighter"><![CDATA[
myColl.removeALL(predi -> "Frank".equals(predi.getName()));
]]></script>
That's it for now. I hope you enjoyed my first part of my Java 8 Blog series. Please notice that "Lambda Part 2: Deep Dive" is currently in work. I will publish as soon as I can. I will show you some technical specifications, rules and compiler behavior to make the demystification perfect. So long.<br/><br/>
<center>
<table width="80%" bgcolor="#fAfAfA" cellpadding="15" style="border: 1px dashed #ccc;"><tbody>
<tr><td><span style="font-size: x-large;">Java 8 Blog Series</span><br />
<ul>
<li><a href="http://frankhinkel.blogspot.de/2012/11/java-8-closures-lambda-expressions.html">Closures, Lambda Expressions - Part 1: Demystified (JSR 335)</a></li>
<li>Closures, Lambda Expressions - Part 2: Deep Dive (JSR 335)</li>
<li>Project Jigsaw - Modularization of the JDK</li>
<li>Date and Time API - JSR 310</li>
<li>Type Annotiations and Checker Framework - JSR 308</li>
<li>Concurrent Collection Framework</li>
</ul>
</td></tr>
</tbody></table>
</center>
Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com15tag:blogger.com,1999:blog-7833890125551874480.post-21909894298663397682012-11-27T21:00:00.000+01:002012-11-28T15:58:54.472+01:00My Top 5 Books of 2012This is one of my favorite post of the year to write. It gives me the opportunity to look back on some of the great books I read during the past year. Most of them are highly coupled to my current job as a Software Engineer within an architecture deparment. Nevertheless I have chosen one book into the top that is more management driven, because it is the best thing I have read so far (about project management).<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvtIgLmJ8S6sJW9N_tXwZUOhyphenhyphenLIFGJK1n5g2xzXuLA2X2-s0zpFaRoAYY6CRkyK5xqsi1Mre78EriDOOYWGSkogavoBAd5tjr_uB-V7D1xegEGGDaJPbCeKsHL1pHTGieGSUpC1zRglfY/s1600/41fyjTVARFL._SL500_AA300_.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvtIgLmJ8S6sJW9N_tXwZUOhyphenhyphenLIFGJK1n5g2xzXuLA2X2-s0zpFaRoAYY6CRkyK5xqsi1Mre78EriDOOYWGSkogavoBAd5tjr_uB-V7D1xegEGGDaJPbCeKsHL1pHTGieGSUpC1zRglfY/s200/41fyjTVARFL._SL500_AA300_.jpg" width="200" /></a><span style="font-size: large;"><span style="color: #999999;">No. 1</span><span style="font-size: large;"> </span><span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">The Passionate Programmer </span></span></span><br />
<b><span style="font-size: small;">Creating a Remarkable Career in Software Development </span></b><br />
<i>by Chad Fowler</i><br />
<br />
Chad Fowler is a great "Programming Lifestyle Engineer". He tells us what we need to do to be successfull as an IT-Spezialist. The book contains tons of stunning wisdoms like the "Broken Window Theory" or statements like "You can't win if you just try not to lose." It is so common for developers to be unsatisfied because they only try not to lose. They do not push thier own skill and never try to win a knowledge race. I recommend this book to everyone who is working at the IT.<br />
<br />
<br />
<span style="font-size: large;"><span style="color: #999999;">No. <span style="font-size: large;">2</span></span><span style="font-size: large;"> <span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">A Guide to the Project Management Body of Knowledge</span></span></span></span><b><span style="font-size: small;"> </span></b><br />
<b><span style="font-size: small;">4th Edition</span></b><br />
<i>by Project Management Institute </i><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRpmeiSlqkEwlZHBy-OltSkcAfrhA20p-zR4o_J8_DNsLPI2Trz0crZzlZ7W6u9H9gT-2mHLQ9ukGoa7s81JPIvfeSQc3toeG22DsKAwAWNFXmsHaMPHTvs6M698afZONPuXMhq7m9y-I/s1600/A-Guide-to-the-Project-Management-Body-of-Knowledge-9781933890517.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRpmeiSlqkEwlZHBy-OltSkcAfrhA20p-zR4o_J8_DNsLPI2Trz0crZzlZ7W6u9H9gT-2mHLQ9ukGoa7s81JPIvfeSQc3toeG22DsKAwAWNFXmsHaMPHTvs6M698afZONPuXMhq7m9y-I/s200/A-Guide-to-the-Project-Management-Body-of-Knowledge-9781933890517.jpg" width="154" /></a></div>
A Guide to the Project Management Body of Knowledge (PMBOK Guide) is a book which presents a set of standard terminology and guidelines for project management. The Fourth Edition (2008) is the document resulting from work overseen by the Project Management Institute (PMI). The Guide recognizes 42 processes that fall into five basic process
groups and nine knowledge areas that are typical of almost all projects. By that the PMBOK Guide is a very complete systematical approach to handle project specific complexity. Moreover PMI has an practical orientation. It is made by practitioner for practitioner. And that is what I appreciate. "Hands-on" project management.<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;"><span style="color: #999999;">No. <span style="font-size: large;">3</span></span><span style="font-size: large;"> <span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">Patterns of Enterprise Application Architecture</span></span></span></span><b><span style="font-size: small;"> </span></b><br />
<b><span style="font-size: small;">Martin Fow<span style="font-size: small;">ler Signature Series</span></span></b><br />
<i>by Martin Fowler</i><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr1NZq3M1rfhO6MNlOifTZibGpsKYepMW_NPDuNbYPUvRe3p8QoWhICdNRPoTbu6uYyOf98ufYW07gBbUdLtTe7i4209S7FDOFpJWsurrU8FlKyOcrGyIYYqKEr08MdaBpHtRhyphenhyphenXFvGko/s1600/Patterns+of+Enterprise+Application+Architecture.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhr1NZq3M1rfhO6MNlOifTZibGpsKYepMW_NPDuNbYPUvRe3p8QoWhICdNRPoTbu6uYyOf98ufYW07gBbUdLtTe7i4209S7FDOFpJWsurrU8FlKyOcrGyIYYqKEr08MdaBpHtRhyphenhyphenXFvGko/s200/Patterns+of+Enterprise+Application+Architecture.jpg" width="159" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKNn6pIqaS6DdIM0vKDgxCvN36UWXA1SuAmr4i0HnFNpnRa_XaYQDHSUVPxQGMJdg0KPOr5YxmsVVptBuX5tQaHKeayWobhoBwduUethzXnc9RqlWbuZKuVtdOV2OaRZbSJtR3MCr_gF0/s1600/Book-Jeld.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
This outstanding collection of Enterprise Patterns leads into the topic of Enterprise Architecture and describes some handpicked design patterns. Each pattern describes details of how it works and when to
use it, together with code examples. The main topic areas are: how to layer an enterprise
application, how to organize domain logic, how to tie that logic
to a relational database, how to design a web based
presentation, some important principles in distributed design,
and handling of what we call "offline concurrency" - concurrency
that spans transactions. This book helped me a lot to understand unknown frameworks as well as designen and developing enterprise software.<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;"><span style="color: #999999;">No. <span style="font-size: large;">4</span></span><span style="font-size: large;"> <span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">Java Puzzlers</span></span></span></span><span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><span style="font-size: x-large;">: Traps, Pitfalls, and Corner Cases</span></span></span><b><span style="font-size: small;"><span style="font-size: small;"></span></span></b><br />
<i>by Joshua Bloch, Neal Gafter</i><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJQvDSDTI8hEHVf6KBhR9lx2xTsIhSsmFBhDyyfg7ButtD6rRHD2AC7hdcW5YhOlWAVYzIi4x6coa19XR07eHQQwTNp4yGdBuDDb-NsCZHnZ3VjrlYXpIOXXqgQFXNRv78pYl64oLOd4/s1600/51EYbxfd8iL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU03_.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDJQvDSDTI8hEHVf6KBhR9lx2xTsIhSsmFBhDyyfg7ButtD6rRHD2AC7hdcW5YhOlWAVYzIi4x6coa19XR07eHQQwTNp4yGdBuDDb-NsCZHnZ3VjrlYXpIOXXqgQFXNRv78pYl64oLOd4/s200/51EYbxfd8iL._BO2,204,203,200_PIsitb-sticker-arrow-click,TopRight,35,-76_AA300_SH20_OU03_.jpg" width="156" /></a>The topic tells everthing about the book. It is just a crazy collection of traps, pitfalls and corner cases of the Java Language 2.0. For me as an big Java Fan it has been a lot of fun to read this book and try to solve or figure out the snippets. It is as an brainteaser almost as good as the concurrency courses of Heinz Kabutz.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-size: large;"><span style="color: #999999;"> </span></span><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_96cKXJJ-8BDGd_2qmJdXUZNP2k8jIdrla5pr0dtRADG1GjiifRoJTlJ285jav8iqPIhqWPgkQYiR-ASnFzZIbiMD6DoUIPZcPxHoK7RuhvSJEHKVDiSOGRyosUgfprUepn_j-qDh6c/s1600/3094.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik_96cKXJJ-8BDGd_2qmJdXUZNP2k8jIdrla5pr0dtRADG1GjiifRoJTlJ285jav8iqPIhqWPgkQYiR-ASnFzZIbiMD6DoUIPZcPxHoK7RuhvSJEHKVDiSOGRyosUgfprUepn_j-qDh6c/s200/3094.jpg" width="136" /></a><br />
<span style="font-size: large;"><span style="color: #999999;">No. <span style="font-size: large;">5</span></span><span style="font-size: large;"> <span style="font-size: x-large;"><span style="font-family: Georgia,"Times New Roman",serif;">Java Web Services in der Praxis</span></span></span></span><b><span style="font-size: small;"> </span></b><br />
<b><span style="font-size: small;">Realisierung einer SOA mit WSIT, Metro und Policies<span style="font-size: small;"></span></span></b><br />
<i>by Oliver Heuser, Andreas Holubek </i><br />
<br />
This is a german book that I have to mention. I used it to prepare for my "Oracle Certified Expert - Java EE 6 Web Services Developer" Exam. I was looking for informativ stuff, that could help me to learn all the things that I needed. And this is by far the best thing I found. It covers almost everything you need to know if you take it serious with Web Services and you want to use them in an enterprise environment.<br />
<br />
<br />Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com2tag:blogger.com,1999:blog-7833890125551874480.post-45543295798604110112012-10-27T21:35:00.001+02:002012-10-27T21:35:32.447+02:00Dispatching Web Service calls (Async, Sync, OneWay)If you decide to work with Web Services as a possible SOA implementation, you have to read and understand very much specifications. In Java you may start with JAX-WS and JAX-RS as a SOAP and RESTful way to get your things done. In this Blog I jump deep into JAX-WS to use the Dispatch API. You can see the different synchronous and asynchronous ways to send and recieve messages from a Web Service. Most important goal is to unterstand how "OneWay" dispatching works.<br />
<br />
<br />
<h4>
Setting up the environment</h4>
<br />
To keep things as simple as possible I build up a small Web Service
Endpoint and Web Service Client using Java SE. (No EE Container needed) A simple JAXB annotation binded message class will be the communication artifact. This leads us to simple Szenario:<br />
<ul>
<li>Java SE Web Server (Endpoint, JAX-WS)</li>
<li>Java SE Client (Dispatch, JAX-WS)</li>
<li>JAXB compatible Message Class</li>
</ul>
<br />
<br />
<h3>
JAXB compatible Message Class</h3>
<br />
First we create a class that can deliver our messages. It has to be JAXB friendly, so we use corresponding annotations to declare Java and XML Binding. <br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MyJaxbMessage.java</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[package de.hinkel.jaxws;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "message")
public class MyJaxbMessage {
@XmlElement private String argument;
@XmlElement private String result;
public MyJaxbMessage() {}
public MyJaxbMessage(String argument) {
this.argument = argument;
}
//getter + setter
}
]]></script></td> </tr>
</tbody></table>
<br />
<br />
<h3>
Java SE Web Server (Endpoint, JAX-WS)</h3>
<br />
Then we create a simple server instance that will respond to our client dispatcher. The server will wait 3 seconds to simulate some work.<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingServer.java</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[package de.hinkel.jaxws;
import java.util.Date;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Provider;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceProvider;
@ServiceMode(Mode.PAYLOAD)
@WebServiceProvider(
portName = "Hello",
serviceName = "Examples",
targetNamespace = "urn:examples"
)
public class MessagingServer implements Provider<source> {
private JAXBContext jaxbContext;
MessagingServer() throws JAXBException {
jaxbContext = JAXBContext.newInstance(MyJaxbMessage.class);
}
public static void main(String[] args) throws Exception {
String url = "http://127.0.0.1:8089/Messaging";
Endpoint.publish(url, new MessagingServer());
}
public Source invoke(Source payload) {
try {
Unmarshaller u = jaxbContext.createUnmarshaller();
MyJaxbMessage message = (MyJaxbMessage) u.unmarshal(payload);
Thread.sleep(3000);
message.setResult("Hello, " + message.getArgument() +
" from server: " + new Date());
return new JAXBSource(jaxbContext, message);
} catch (Exception ex) {
throw new WebServiceException(ex);
}
}
}
]]></script></td> </tr>
</tbody></table>
<br />
<br />
<h3>
Java SE Client (Dispatch, JAX-WS)</h3>
<br />
Now we build up our simple client that calls the server in four different ways.<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingClient.java - Part 1</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[package de.hinkel.jaxws;
import java.util.Date;
import java.util.concurrent.Future;
import javax.xml.bind.JAXBContext;
import javax.xml.namespace.QName;
import javax.xml.ws.AsyncHandler;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Response;
import javax.xml.ws.Service;
import javax.xml.ws.Service.Mode;
import javax.xml.ws.soap.SOAPBinding;
public class MessagingClient {
public static void main(String[] as) throws Exception {
// Setting up
QName serviceName = new QName("urn:examples", "Examples");
QName portName = new QName("urn:examples", "Hello");
Service service = Service.create(serviceName);
service.addPort(
portName,
SOAPBinding.SOAP11HTTP_BINDING,
"http://127.0.0.1:8089/Messaging"
);
JAXBContext jaxbCtx = JAXBContext.newInstance(MyJaxbMessage.class);
Dispatch<object> port = service.createDispatch(
portName,
jaxbCtx,
Mode.PAYLOAD
);
MyJaxbMessage requestNormal = new MyJaxbMessage("Foo 1");
MyJaxbMessage requestOneWay = new MyJaxbMessage("Foo 2");
MyJaxbMessage requestFuture = new MyJaxbMessage("Foo 3");
MyJaxbMessage requestResponse = new MyJaxbMessage("Foo 4");
// ...
]]></script></td> </tr>
</tbody></table>
<br />
<br />
Dispatch a synchronous call. Blocking and waiting for server response 3 seconds.
<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingClient.java - Part 2</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[
// ...
// synchronous
System.out.println("1 - Normal - Start: " + new Date());
MyJaxbMessage response = (MyJaxbMessage) port.invoke(requestNormal);
System.out.println("1 - Normal - End: " + new Date() +
" response: " + response.getResult());
// ...
]]></script></td> </tr>
</tbody></table>
<br />
Result Log<br />
<br />
<span style="font-size: x-small;">1 - Normal - Start: Sat Oct 27 20:42:44 CEST 2012<br />1 - Normal - End: Sat Oct 27 20:42:47 CEST 2012 response: Hello, Foo 1 from server: Sat Oct 27 20:42:47 CEST 2012</span><br />
<br />
<br />
Dispatch a OneWay call. Important: The call is synchronous!<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingClient.java - Part 3</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[
// ...
// one Way - is not asynchronous waits for HTTP response
System.out.println("2 - OneWay - Start: " + new Date());
port.invokeOneWay(requestOneWay);
System.out.println("2 - OneWay - no response End: " + new Date());
// ...
]]></script></td> </tr>
</tbody></table>
<br />
Result Log
<br />
<br />
<span style="font-size: x-small;">2 - OneWay - Start: Sat Oct 27 20:42:47 CEST 2012<br />2 - OneWay - no response End: Sat Oct 27 20:42:50 CEST 2012</span><br />
<br />
As shown in result log the OneWay call was synchronous. The server responded just an empty message. This is usefull to reduce network communication but will NOT make a call asynchronous. Same counts for the @OneWay annotation.<br />
<br />
<br />
Asynchronous call with Response<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingClient.java - Part 4</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[
// ...
// asynchronous request
System.out.println("3 - Asynchronous - Start: " + new Date());
Response<object> responseASR = port.invokeAsync(requestResponse);
System.out.println("3 - Asynchronous - End: " + new Date());
while (!responseASR.isDone()) {
Thread.sleep(900);
System.out.println(" - 3.1 simulating async work");
}
MyJaxbMessage res = (MyJaxbMessage) responseASR.get();
System.out.println(" - 3.2 Asynchronous request respondet at: "
+ new Date() + " with Response: " + res.getResult());
// ...
]]></script></td> </tr>
</tbody></table>
<br />
Result Log<br />
<br />
<span style="font-size: x-small;">3 - Asynchronous - Start: Sat Oct 27 20:42:50 CEST 2012<br />3 - Asynchronous - End: Sat Oct 27 20:42:50 CEST 2012<br /> - 3.1 simulating async work<br /> - 3.1 simulating async work<br /> - 3.1 simulating async work<br /> - 3.1 simulating async work<br /> - 3.2 Asynchronous request respondet at: Sat Oct 27 20:42:54 CEST 2012 with Response: Hello, Foo 4 from server: Sat Oct 27 20:42:53 CEST 2012</span><br />
<br />
<br />
Asynchronous call with Future<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" style="border: solid 1px; width: 100%px;"><tbody>
<tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">MessagingClient.java - Part 5</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[
// ...
// asynchronous with Future
AsyncHandler<object> responseHandler = new AsyncHandler<object>() {
public void handleResponse(Response<object> resp) {
try {
MyJaxbMessage result = (MyJaxbMessage) resp.get();
System.out.println(" - Future responded asynchronous "
+ result.getResult());
} catch (Exception e) {
e.printStackTrace();
}
}
};
System.out.println("4 - Asynchronous with Future Start: " + new Date());
Future<?> f = port.invokeAsync(requestFuture, responseHandler);
System.out.println("4 - Asynchronous with Future End: " + new Date());
while (!f.isDone()) {
Thread.sleep(900);
System.out.println(" - 4.1 simulating async work");
}
System.out.println("4 - Asynchronous request with Future respondet at: "
+ new Date() + " with Response: " + f.get());
}
}
]]></script></td> </tr>
</tbody></table>
<br />
Result Log<br />
<br />
<span style="font-size: x-small;">4 - Asynchronous with Future Start: Sat Oct 27 20:42:54 CEST 2012<br />4 - Asynchronous with Future End: Sat Oct 27 20:42:54 CEST 2012<br /> - 4.1 simulating async work<br /> - 4.1 simulating async work<br /> - 4.1 simulating async work<br /> - Future responded asynchronous Hello, Foo 3 from server: Sat Oct 27 20:42:57 CEST 2012<br /> - 4.1 simulating async work<br />4 - Asynchronous request with Future respondet at: Sat Oct 27 20:42:57 CEST 2012 with Response: de.hinkel.jaxws.MyJaxbMessage@ee51b2c</span><br />
<br /><br />As shown in the result logs we sucessfully made 4 diffierent kinds of Web Service calls just by invoking different methods an the Dispatch class. 1. Synchronous with response, 2. Synchronous without response, 3. Asynchronous with response, 4. Asynchronous with future. Moreover we could see how Java SE enables advanced Web Service Endpoint- and Client testing by a programmatically approach of JAXB and JAX-WS usage.Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com1tag:blogger.com,1999:blog-7833890125551874480.post-1724077618457754002012-01-31T09:37:00.279+01:002012-10-09T09:39:51.898+02:00PMBOK und PRINCE2 - Ein systematischer Vergleich im Projektmanagement<div align="justify">
Nachdem ich im Rahmen einer Fallstudie die beiden Themen erarbeitet habe, möchte ich einige gewonne Erkentnisse veröffentlichen. Überraschend für mich war die enorme Verbreitung und Community rund um PMBOK, die ich in dem Ausmaß nicht erwartet hatte. Vorab möchte ich noch kurz als Einführung die Begriffe PMBOK und PRINCE2 erläutern:</div>
<br />
<span style="font-size: x-large;">Grundlagen</span><br />
<br />
<span style="font-size: large;">PMBOK</span><br />
<div align="justify">
Die Abkürzung steht für "Project Management Body of Knowledge" und gemeint ist in der Regel der PMBOK Guide, welcher als ein Rahmenwerk im Bereich Projektmanagement zu verstehen ist. Urheber des PMBOK Guide ist PMI, ein nicht gewinnorientierter Verband zu dem weltweit über 400.000 Mitglieder zählen. Das Ziel von PMI ist es das Berufsbild als "Projektmanagers" weiter wachsen zu lassen und die eigenen Methoden kontinuierlich zu verbessern. Neben Projektmanagement-Techniken und Vorgehensweisen die über 25 Jahre praktische Erfahrung gereift sind, gibt es wissenschaftliche Akkreditierungen von PMI, sowie Colleges, Zertifizierungen, virtuelle Netzwerke und lokale Chapter in einzelnen Regionen.</div>
<br />
<span style="font-size: large;">PRINCE2</span><br />
<div align="justify">
Der Begriff steht für "Projects in Controlled Environments" und ist die Weiterentwicklung der PRINCE-Methode, welche Prozesse, Techniken und Komponenten im Bereich Projektmanagement anbietet. Die Historie ist ähnlich lang wie bei PMBOK, dennoch liegen die Wurzeln von PRINCE2 in der IT-Branche. Die Methode ist Eigentum der Regierung Großbritanniens und wird vor allem dort und in politisch verbundenen Ländern wie Australien, Indien oder Südafrika eingesetzt. In Deutschland gibt es diesbezüglich einen steigenden Trend. Im Jahre 2011 wurden deutschlandweit 3.500 PRINCE2 Foundation Schulungen gehalten. Diesbezüglich stellt das Cabinet Office auch ein ausgefeiltes Zertifizierungskonzept bereit.</div>
<br />
<span style="font-size: large;">Projekt</span><br />
<div align="justify">
Das Ziel von Wirtschaftsunternehmen ist die Leistungserstellung in Form von Produkten und Dienstleistungen, sowie der dazugehörige Vertrieb. Der sich dabei wiederholende Routineprozess wird als Linienarbeit bezeichnet. Diese spiegelt sich meist in Form einer Linienorganisation wieder, welche auf den Leistungserstellungsprozess optimiert ist. Im Gegensatz dazu müssen sich Unternehmen Innovationsprozessen stellen. Diese können sehr vielgestaltig ausfallen und dabei unterschiedlich strukturiert werden. Entsprechen sie neben der Neuartigkeit noch den Kriterien der zeitlichen Begrenzung und Komplexität, können diese Aufgaben als Projekte realisiert und organisiert werden.</div>
<br />
<span style="font-size: large;">Projektmanagement</span><br />
<div align="justify">
Die fundamentale Aufgabe von Projektmanagement ist die Sicherstellung der Erreichung von definierten Projektzielen. Dabei umfasst Projektmanagement Instrumente und Methoden zur Planung und Steuerung sowie Methoden zur Führung und Modelle zur Organisation der Projektstruktur. Die Instrumente sind dabei auf eine ganzheitliche Betrachtung des Projektes ausgelegt. Es haben sich Methoden und Erfahrungswerte im Rahmen von Projektmanagement angesammelt und erlaubten das Etablieren von verschieden Projektmanagement-Rahmenwerken wie der PMBOK und Projektmanagement-Methoden PRINCE2. </div>
<br />
<br />
<span style="font-size: x-large;">Systematischer Vergleich</span><br />
<br />
<span style="font-size: large;">Vergleichskriterien</span><br />
<div align="justify">
Anlässlich der langen Historie und dem entstandenen Aufbau von fundierten Erfahrungswerten beider Methoden, werden zunächst Hintergründe und Entstehungen betrachtet. Anschließend werden die federführenden Institutionen und Umgebungen welche hinter PRINCE2 und PMBOK stehen untersucht. Beide bieten eine unterschiedliche Vielfalt von Integration und Kollaboration zum Urheber der Methode und der Community. Somit trägt die Umgebung zur Auswahl der geeigneten Methodik bei. Im Anschluss daran wird die Verbreitung und Anwendung betrachtet und um aktuelle Relevanz- und Trendanalysen ergänzt. Danach werden die inhaltlichen Kriterien von PRINCE2 und PMBOK diskutiert und die wesentlichen Merkmale herausgearbeitet. Dabei sollen Konflikte und Gemeinsamkeiten identifiziert werden. Im Abschluss der analytischen Ausarbeitung werden die Ziele beider Methoden betrachtet.</div>
<br />
<span style="font-size: large;">Analytische Ausarbeitung - PMBOK</span><br />
<br />
<b><span style="font-size: small;">Historie</span></b> <br />
<div align="justify">
Am neunten Oktober 1969 wurde die Gründung des Project Management Instituts (PMI) offiziell bekannt gegeben. Zu diesem Zeitpunkt hatte sich das Tätigkeitsfeld des Projektmanagements wenig etabliert. Mit der Erkenntnis, dass viele verschiedene Projektmanagement Methoden und Techniken angewendet werden können entwickelte sich PMI zur weltweit größten Projektmanagementorganisation. Dabei spielten freiwillige, welche Interesse an der Entwicklung des Berufsbildes im Bereich Projektmanagement hatten, eine entscheidende Rolle. Im Jahre 1981 wurde vom PMI Board of Directors ein Projekt genehmigt, welches unter anderem die Entwicklung einer Projektmanagementnorm beinhalteten sollte. Darauf folgte 1983 die Veröffentlichung einer ersten Normierungsrichtlinie für Projektmanagement. Diese Basis resultierte 1987 in dem Project Management Body of Knowledge (PMBOK) welcher nach zahlreichen Feedbacks und Erkenntnissen aus praktischer Anwendung zu einer aktualisierten Auflage führte. Diese wurde 1996 unter dem Namen „A Guide to the Project Management Body of Knowledge“ (PMBOK Guide) veröffentlicht. Es folgten in vierjährigen Zyklen weitere Ausgaben, sodass 2000, 2004 und 2008 vier Aktualisierungen mit praktischen Erfahrungen angereichert wurden. Als Resultat beinhaltet der PMBOK Guide wissen aus 25 Jahren praktischer Erfahrung im Bereich Projektmanagement.</div>
<br />
<b><span style="font-size: small;">Federführende Institutionen und Umgebung</span></b> <br />
<div align="justify">
PMI ist die federführende Institution hinter dem PMBOK Guide und agiert dabei weltweit als nicht gewinnorientierter Berufsverband. Dabei verfolgt PMI das Ziel das Thema Projektmanagement in den Bereichen der Forschung, praktischer Anwendung und Erschaffung des Berufsbildes im Bereich Projektmanagement voran zu treiben. PMI und die verbundenen Initiativen beruhen auf einer kleinen Gruppe hauptamtlicher Mitarbeiter welche für die Verwaltung zuständig sind und einer großen Mehrheit von Freiwilligen. Hierin spiegelt sich der Grundsatz von PMI wieder, welcher lautet „Für seine Mitglieder – durch seine Mitglieder“.</div>
<br />
<b><span style="font-size: small;">Verbreitung und Trend</span></b> <br />
<div align="justify">
PMI ist weltweit verbreitet und hat einen durchschnittlichen Mitgliederzuwachs von rund 20% pro Jahr. Diese Angabe basiert auf den Mitgliederzahlen ab dem Jahr 1975 mit rund 1000 Mitgliedern. 1984 betrug die Zahl bereits 10.000 und erlebte einen rapiden Anstieg, sodass bis 2009 die Anzahl der Mitglieder gegen 400.000 ging. Zur Untermalung dieser Angaben werden Stichproben von Google Trends und einem zentralen Sozial Business Internet Portal zu Rate gezogen. PMI breitet sich in Form von unterschiedlichen Einrichtungen aus. Dazu gehören die Chapter, welche lokale Ortsgruppen sind und für die Mitglieder örtlich erreichbare Fachkräfte beinhalten. Es existieren weltweit über 250 aktive PMI Chapter in über 70 Ländern. Zusätzlich existieren virtuelle Communities, welche PMI für die Bereitstellung einer reichhaltigen Wissensbasis konzipiert hat. Zur Unterstützung einer effektiven Kommunikation unter den Mitgliedern und Stakeholdern stellt PMI Regionalzentren für die Regionen Asien, Indien und EMEA. Entsprechend der Verbreitung gibt es neben der englischen Fassung des PMBOK Guide Übersetzungen in zehn weitere Sprachen. Darüber hinaus verfügt PMI über einen speziellen Forschungsbereich in den bis zum Jahr 2011 an die 16 Millionen US Dollar investiert wurden um innerhalb einer aktiven Projektmanagementforschung mehr als 350 Veröffentlichungen tätigen zu können und den eigenen Standard auch wissenschaftlich reifen zu lassen. Dazu passen auch die PMI spezifischen Colleges, welche sich dem Schwerpunktthema Projektmanagement gewidmet haben, sowie die wissenschaftliche Akkreditierungen an dem „PMI Global Accreditation Center for Project Management“ (GAC). Um hochwertige Trainings zum Thema Projektmanagement und PMBOK sicherzustellen, unterstützt PMI auch ein „Netzwerk registrierter Trainingsanbieter“ (R.E.P.).</div>
<br />
<b><span style="font-size: small;">Inhaltliche Kriterien</span></b> <br />
<div align="justify">
Der PMBOK Guide beinhaltet 42 Projetmanagementprozesse. Dabei handelt es sich um bewährte Verfahren, welche in Projekten angewendet werden können. PMI fasst diese Prozesse in fünf Prozessmanagementgruppen zusammen: Initiierung, Planung, Ausführung, Überwachung/Steuerung und Abschluss. Ein zentraler Aspekt ist die Ergänzung der Prozesse um eine Struktur, welche aus neun Wissensgebieten besteht. Alle Prozesse werden hinsichtlich dieser Wissensgebiete ausführlich dokumentiert. Dabei werden bezüglich der Prozesse jeweils die Eingangswerte, sowie die Werkzeuge und Techniken zur Durchführung und die Ausgangswerte und Resultate betrachtet. Folgende Tabelle stellt alle Prozesse, sowie deren Tätigkeiten innerhalb der jeweiligen Wissensgebiete dar.</div>
<br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">Wissensgebiet</td> <td align="center">Initiierung</td> <td align="center">Planung</td> <td align="center">Ausführung</td> <td align="center">Überwachung/ Steuerung</td> <td align="center">Abschluss</td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Integrationsmanagement</td> <td>Projektauftrag entwickeln</td> <td>Projektmanagentplan entwickeln</td> <td>Projektdurchführung lenken und managen</td> <td>Projektarbeit überwachen und steuern</td> <td>Projekt oder Phase abschließen</td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Inhalts- und Umfangsmanagement</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Anforderungen sammeln, Inhalt und Umfang Definieren, Projektstrukturplan erstellen</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Inhalt und Umfang verifizieren, Inhalt und umfang steuern</td> <td style="background-color: #eeeeee;"></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Zeitmanagement</td> <td></td> <td>Vorgänge festlegen, Vorgangsfolge festlegen, Ressourcen für Vorgänger schätze, Vorgangsdauer schätzen, Terminplan entwickeln</td> <td></td> <td>Terminplan steuern</td> <td></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Kostenmanagement</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Kosten schätzen, Budget festlegen</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Kosten steuern</td> <td style="background-color: #eeeeee;"></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Qualitätsmanagement</td> <td></td> <td>Qualität planen</td> <td>Qualitätssicherung durchführen</td> <td>Qualitätslenkung durchführen</td> <td></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Personalmanagement in Projekten</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Personalbedarfsplan entwickeln</td> <td style="background-color: #eeeeee;">Projektteam zusammenstellen, entwickeln, managen</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;"></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Kommunikations- management</td> <td>Stakeholder identifizieren</td> <td>Kommunikation planen</td> <td>Informationen verteilen, Stakeholder Erwartungen managen</td> <td>Projektleistung berichten</td> <td></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Risikomanagement</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Risikomanagement planen, Risiken identifizieren, Qualitative Risikoanalyse durchführen, Quantitative Risikoanalyse durchführen, Risikobewältigungsmaßnahmen planen</td> <td style="background-color: #eeeeee;"></td> <td style="background-color: #eeeeee;">Risiken überwachen und steuern</td> <td style="background-color: #eeeeee;"></td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Beschaffungsmanagement</td> <td></td> <td>Beschaffung planen</td> <td>Beschaffung durchführen</td> <td>Beschaffung verwalten</td> <td>Beschaffung abschließen</td> </tr>
</tbody></table>
<br />
<b><span style="font-size: small;">Ziele</span></b> <br />
<div align="justify">
Der PMBOK Guide erhebt nicht den Anspruch eines dogmatischen Projektmangement-Rezeptbuchs. Vielmehr sollen die Prozesse und Wissensgebiete von Projektleitern und Projektteam zielgerichtet ausgewählt werden, da jedes Unternehmen eine einzigartige Kultur hat und unterschiedlichen Herausforderungen gegenübersteht. Hierbei sollte ausreichend Wissen über die Prozesse aufgebaut werden und auf Erfahrung anderer zurückgegriffen werden können. Die von PMI etablierte Community sollte hier Anwendung finden. Ein maßgebliches Ziel von PMI ist es dabei den Beruf im Bereich Projektmanagement weiter voran zu treiben und die im PMBOK Guide enthaltenen Methoden kontinuierlich zu verbessern. Dabei werden Erfahrungswerte aus Praxis sowie aus wissenschaftlichen Untersuchungen berücksichtigt.</div>
<br />
<span style="font-size: large;">Analytische Ausarbeitung - PRINCE2</span><br />
<br />
<b><span style="font-size: small;">Historie</span></b> <br />
<div align="justify">
Im Jahre 1989 veröffentlichte die “Central Computer and Telecommunications Agency” (CCTA) einen Standard im Bereich Projekt Management Methodik mit dem Namen PRINCE. Nachdem die CCTA umbenannt wurde in „Office of Government Commerce“ (OGC), zog diese im Juni 2010 als britische Regierungsinstitution in das Cabinet Office. PRINCE basiert auf der Projekt Management Methode PROMPT, welche 1979 von der CCTA übernommen wurde, da ein Nutzen für die Projekte der britischen Regierung im informationstechnischen Bereich erwartet wurde. Die britische Krone hält bis heute die Rechte an PRINCE und PRINCE2. Im Jahre 1996 wurde in Zusammenarbeit mit einem virtuellen Komitee – bestehend aus 150 Unternehmen – der PRINCE2 Standard verabschiedet. In den Jahren 2002 und 2005 gab es zwei Aktualisierungen der Methode. Dies war das Ergebnis einer Zusammenarbeit mit einer internationalen PRINCE2 Gemeinschaft. Um Projektmanagern ein besseres Toolset an die Hand zu geben und Projekte im zeitlichen und wirtschaftlichen Rahmen hochwertig fertig zu stellen, wurde im Jahr 2009 PRINCE2 einer größeren Aktualisierung unterzogen, welche die Methode um sieben Prinzipien erweiterte.</div>
<br />
<b><span style="font-size: small;">Federführende Institutionen und Umgebung</span></b> <br />
<div align="justify">
PRINCE2 ist eine geschützte und eingetragene Handelsmarke des Cabinet Office der britischen Regierung. Diese treibt die Weiterentwicklung zusammen mit der internationalen PRINCE2 Gemeinschaft voran. Neben Einrichtungen der britischen Regierung existiert weltweit eine Vielzahl von unabhängigen Institutionen, mit dem Ziel in der jeweiligen Region PRINCE2 weiter zu etablieren und reifen zu lassen. Oft handelt es sich dabei um nicht gewinnorientierte Vereine, sondern Gemeinschaften mit rein fachlichem Interesse an der Thematik. Darüber hinaus existiert ein ausgefeiltes Zertifizierungskonzept, welches eine Umgebung mit Prüfungen, Schulungen und Literatur mit sich bringt. Insbesondere in Großbritannien werden solche Zertifizierungen explizit bei der Einstellung von Projektmanagern verlangt. Aber auch in anderen Ländern wirken sich diese Titel positiv auf das eigene Profil aus.</div>
<br />
<b><span style="font-size: small;">Verbreitung und Trend</span></b> <br />
<div align="justify">
In Großbritannien gilt PRINCE2 als De-Facto Standard für Projektmanagement und wird darüber hinaus in über 50 Ländern weltweit angewendet. Im Jahr 2009 erschein eine größere Aktualisierung der PRINCE2 Methode. Insbesondere im informationstechnischen Bereich hat sich PRINCE2 etabliert, da dort die Wurzeln der Methode liegen. Dennoch ist dem Cabinet Office gelungen über diese Grenze hinauszuwachsen und in anderen Branchen und Bereichen PRINCE2 Projekte erfolgreich durchzuführen. Länder welche mit Großbritannien politisch verbunden sind, setzen ebenfalls die PRINCE2 Methode schwerpunktmäßig ein. Deswegen ist die Akzeptanzrate in Australien, Indien und Südafrika hoch. In Jahren 2008 bis 2011 stieg allerdings auch die Verbreitung der Methoden in den europäischen Ländern. Dementsprechend wurden in Deutschland im Jahr 2011 an die 3.500 PRINCE2 Foundation Schulungen absolviert. Bis Ende 2011 wurden weltweit mehr als 900.000 PRINCE2 Zertifikate ausgestellt. Jährlich kommen ca. 70.000 neue hinzu. PRINCE2 ist offiziell in 10 Sprachen verfügbar.</div>
<br />
<b><span style="font-size: small;">Inhaltliche Kriterien</span></b> <br />
<div align="justify">
Die PRINCE2 Methode ist in drei Arten von Strukturelementen ausgeteilt: Prozesse, Komponenten und Techniken. Die Prozesse umschließen Aktivitäten und Rollen mit dem Ziel festzulegen welches Ergebnis zu welchem Zeitpunkt von wem durchgeführt werden soll. Die Komponenten liegen als Querschnittsthemen auf den Prozessen und beinhalten Aspekte wie Pläne, Risiko und Qualität. Um dieses zu realisieren beschreibt PRINCE2 einen Satz von Techniken, welche als reine Vorschläge verstanden werden und gegen andere und bevorzugte Techniken ersetzt werden können. Es muss allerdings sichergestellt werden, dass die Komponentenziele dabei eingehalten werden. Die folgende Übersicht zeigt das fest definierte Fundament von PRINCE2, bestehend aus acht Prozessen, acht Komponenten und drei Techniken:</div>
<br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Techniken</td> <td><ul>
<li>Produktgrundplanung<br />
<ul>
<li>Produktanalyse, Produktbeschreibung, Produktflussdiagram</li>
</ul>
</li>
<li>Qualitätsbewertung<br />
<ul>
<li>Vorbereitung, Bewertung, Nachfolge</li>
</ul>
</li>
<li>Änderungskontrolle<br />
<ul>
<li>Erfassung, Protokollierung, Abschätzung, Endscheidung</li>
</ul>
</li>
<li>Projektabwicklungsstruktur<br />
<ul>
<li>Managementakte, Spezialisierungsakte, Qualitätsakte</li>
</ul>
</li>
</ul>
</td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Komponenten</td> <td style="background-color: #eeeeee;"><ul>
<li>Organisation<br />
<ul>
<li>Beschreibung von Rollen u. Struktur</li>
</ul>
</li>
<li>Planung<br />
<ul>
<li>Produkte, Aktivitäten, Ressourcen</li>
</ul>
</li>
<li>Steuerung<br />
<ul>
<li>Management, Team, Qualität</li>
</ul>
</li>
<li>Phasen<br />
<ul>
<li>Management und technische Phasen</li>
</ul>
</li>
<li>Risikomanagement<br />
<ul>
<li>Risikoabschätzung und Management</li>
</ul>
</li>
<li>Qualität der Projektumgebung<br />
<ul>
<li>Qualität der Anforderungen und Rückmeldungen</li>
</ul>
</li>
<li>Konfigurationsmanagement<br />
<ul>
<li>Produktüberwachung und Dokumentation</li>
</ul>
</li>
<li>Änderungssteuerung<br />
<ul>
<li>Erfassung und Beurteilung</li>
</ul>
</li>
</ul>
</td> </tr>
<tr style="border: 1px solid;"> <td style="background-color: #dddddd; font-weight: bold;">Prozesse</td> <td><ul>
<li>Projektvorbereitung (SU)</li>
<li>Projektinitiierung (IP)</li>
<li>Projektlenkung (DP)</li>
<li>Phasensteuerung (CS)</li>
<li>Management der Produktlieferung (MP)</li>
<li>Phasenübergangmanagement (SB)</li>
<li>Projektabschluss (CP)</li>
<li>Planen (PL)</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<b><span style="font-size: small;">Ziele</span></b> <br />
<div align="justify">
Das Ursprüngliche Ziel von PRINCE2 große IT-Projekte zu managen hat sich erweitert. Die PRINCE2 Methode findet Anwendung in Projekten aller Branchen und wird regelmäßig durch neue Erkenntnisse angereichert. Dabei werden Grundsätze und fundamentale Komponenten und Prozesse definiert. Dynamik wird insbesondere bei der Auswahl von konkreten Techniken gewünscht. Hier möchte PRINCE2 nicht zu dogmatisch werden, sondern einen Zielorientierten Rahmen schaffen der es Projektmanagern ermöglicht auch komplexe Projekte fristgerecht, innerhalb des Budgets und hochwertig fertig zu stellen. Zusätzlich soll die Methode weltweit weiter etabliert werden. Dazu werden Zertifizierungen, Schulungen und Vereine außerhalb Großbritanniens willkommen geheißen.</div>
<br />
<span style="font-size: large;">Zusammenfassende Gegenüberstellung</span><br />
<br />
<b><span style="font-size: small;">Historie</span></b> <br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td><ul>
<li>25 Jahre praktische Erfahrung</li>
<li>branchenunabhängig</li>
</ul>
</td> <td><ul>
<li>22 Jahre praktische Erfahrung</li>
<li>Schwerpunkt: IT-Projekte</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<b><span style="font-size: small;">Federführende Institution und Umgebung</span></b> <br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td><ul>
<li>PMI (weltweiter Berufsverband)</li>
<li>nicht Gewinnorientiert</li>
<li>Colleges</li>
<li>Wissenschaftliche Akkreditierungen</li>
<li>Lokale Chapter</li>
</ul>
</td> <td><ul>
<li>Gehört der Regierung Großbritanniens</li>
<li>Weltweit unabhängige Institutionen vorhanden</li>
<li>Ausgefeilte Zertifizierungsprogramme</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<b><span style="font-size: small;">Verbreitung und Trend</span></b> <br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td><ul>
<li>Weltweit etabliert</li>
<li>20% Mitglieder Zuwachs pro Jahr</li>
<li>400.000 Mitglieder im PMI</li>
<li>250 aktive PMI Chapter</li>
<li>In über 70 Länder vertreten</li>
<li>Virtuelle Communites</li>
<li>mehr als 350 wissenschaftliche Veröffentlichungen</li>
</ul>
</td> <td><ul>
<li>De-Facto Standard in Großbritan-nien</li>
<li>Hohe Verbreitung in politisch ver-bundenen Ländern zu Großbritan-nien</li>
<li>Tendenziell weniger verbreitet in Europa</li>
<li>Weltweit 900.000 PRINCE2 Zerti-fikate ausgestellt</li>
<li>In Deutschland wurden 2011 3.500 PRINCE2 Foundationen Schulun-gen absolviert</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<div align="justify">
Um die Zahlen der analytischen Ausarbeitung zu untermalen wurden Stichproben aus den online Quellen Google Trends und der webbasierten Business Plattform XING verwendet, welche Informationen über Stellengesuche und Fähigkeiten ermitteln lässt.</div>
<br />
<u><span style="font-size: small;">Google Trends - Stichprobe</span></u><br />
<div align="justify">
Die suche innerhalb von Google Trends nach den Begriffen „PMBOK“ und „PRINCE2“ führt zur Grafik welche in Abb. 1 dargestellt ist. Der dabei auf der Y-Achse verwendet „Search Volume Index“ ist ein von Google festgelegter Wert, der die aktuellen Suchbegriffe in Relation zum Gesamtvolumen der Suchanfragen setzt. Entscheidend ist demnach der Trend. Dabei ist zu erkennen, dass PMBOK und PRINCE2 einen ähnlich abnehmenden Trend aufweisen. Zusätzlich kann festgestellt werden, dass der Index zum „News Reference Volume“ insbesondere bei PRINCE2 in den Jahren 2009 und 2010 auffällig angestiegen ist. Der „News Reference Volume“ gibt Auskunft darüber wie oft der Suchtbegriff – in dem Fall PRINCE2 – in den Google News Themen aufgetreten ist. Nach Angaben von Google tauchte der Begriff „PRINCE2 2009 Launched“ zu diesem Zeitpunkt vermehrt auf.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUiTT8giotTDUCNwzoEiDkbRsmMy2sIv0mQRES7JmK0YIhaJC96NzZLrjZHG7vLIfsrBvMMPAD7QE7V9QdKXsJ3B0tBYt02FzIn7a-2bhq62cFU7SNUiqawQ_oOjSLUxF8chLdT3w2oZg/s1600/bild.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUiTT8giotTDUCNwzoEiDkbRsmMy2sIv0mQRES7JmK0YIhaJC96NzZLrjZHG7vLIfsrBvMMPAD7QE7V9QdKXsJ3B0tBYt02FzIn7a-2bhq62cFU7SNUiqawQ_oOjSLUxF8chLdT3w2oZg/s1600/bild.JPG" /></a><span style="font-size: small;"><br />
Abbildung 1: Google Trends, Stand 28.01.2012</span></div>
<br />
<br />
<u><span style="font-size: small;">XING - Stichprobe</span></u><br />
<span style="font-size: small;">Neben dieser Stichprobe ergab eine Recherche in XING folgendes Ergebnis:</span><br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td></td> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td>Anzahl Mitglieder mit Begriff im Profil</td> <td>Mehr als 10.000</td> <td>Mehr als 10.000</td> </tr>
<tr style="border: 1px solid;"> <td>Anzahl Jobs</td> <td>9</td> <td>13</td> </tr>
<tr style="border: 1px solid;"> <td>Anzahl Gruppen</td> <td>29</td> <td>41</td> </tr>
<tr style="border: 1px solid;"> <td>Anzahl Unternehmen</td> <td>210</td> <td>143</td> </tr>
<tr style="border: 1px solid;"> <td>Anzahl Events</td> <td>79</td> <td>101</td> </tr>
</tbody></table>
<span style="font-size: small;">Abbildung 2: XING Recherche, Stand 28.01.2012</span><br />
<br />
<div align="justify">
Beide Methoden sind ebenfalls hier auf Augenhöhe. Zu erkennen ist jedoch ein größeres Angebot an Gruppen und Events im Bereich PMI, was der hohen Verbreitung des Gemeinschafts und Community Gedankens der Institution entspricht. Wenig aussagekräftig ist hier die ungenaue Anzahl der Mitglieder.</div>
<br />
<br />
<b><span style="font-size: small;">Inhaltliche Kriterien</span></b> <br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td><ul>
<li>Satz von 42 Prozessen, welche für sieben Wissensgebiete eingesetzt werden sollen</li>
<li>Nicht alle müssen eingesetzt wer-den. Der Projektleiter und das Team entscheiden.</li>
</ul>
</td> <td><ul>
<li>Drei Arten von Strukturelementen: Prozesse, Komponenten, Techniken.</li>
<li>Insbesondere die Techniken können ausgetauscht werden.</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<b><span style="font-size: small;">Ziele</span></b> <br />
<table style="border: 1px solid; font-size: 8pt; width: 575px;"><tbody>
<tr style="background-color: #bbbbbb; border: 1px solid; font-weight: bold;"> <td align="center">PMBOK</td> <td align="center">PRINCE2</td> </tr>
<tr style="border: 1px solid;"> <td><ul>
<li>Kein Rezeptbuch, sondern Anleitung.</li>
<li>Berufsbild im Bereich Projektmanagement vorantreiben.</li>
<li>Weiter wachsen und Erfahrungen sammeln.</li>
</ul>
</td> <td><ul>
<li>Die Schaffung eines Rahmens</li>
<li>Vorschläge zu Techniken gegeben</li>
<li>Weltweite Verbreitung vorantrei-ben</li>
</ul>
</td> </tr>
</tbody></table>
<br />
<br />
<span style="font-size: x-large;">Schlussbetrachtung</span><br />
<div align="justify">
Sowohl PRINCE2 als auch PMBOK glänzen mit einer ausführlichen Historie. Beide basieren auf einem Fundament reichhaltiger Erfahrungen in Großprojekten. Besonders im IT-Bereich ist hier PRINCE2 aufgrund seiner Wurzeln ernst zu nehmen. PMBOK hingegen ist unter der Federführung von PMI und einer großen weltweit agierenden Gemeinschaft vertreten. Wenn der Wunsch an aktivem Austausch und Eingliederung in die Welt des Projektmanagements besteht, kann hier sogar bis auf Tätigkeiten in wissenschaftlichen Bereichen zurückgegriffen werden. PRINCE2 und PMBOK unterscheiden sich in einigen Details, Begriffsdefinitionen und Handlungsempfehlungen. Diese Unterschiede sehen Snijders, Wuttke und Zandhaus also Argumente PMBOK nicht mit anderen Methoden zu verbinden. Es mache „keinen Sinn die [Projektbeteiligten] mit verschiedenen Methoden und unterschiedlichen Hintergründen sowie Definitionen zu konfrontieren, und dann auch noch von jedem Einzelnen eine eigene Integrationsübung zu verlangen.“ Dies könne zu Fehlern führen, Missverständnisse oder Irritationen verursachen. Entgegen dieser Meinung wäre rein technisch allerdings eine Integration mit PRINCE2 denkbar, da diese Methode es willkommen heißt die vorgeschlagenen Techniken durch andere zu ersetzen.</div>
<br />
<br />
<hr size="1" />
<span style="font-size: x-large;">Literaturverzeichnis</span><br />
<br />
<b>Monographien</b><br />
<ul>
<li>Kraus G., Westermann R. (2010): Projektmanagement mit System, 4. Aufl., Wiesbaden (2010)</li>
<li>Snijders P., Wuttke T., Zandhuis A. (2011): Eine Zusammenfassung des PMBOK Guide, 1. AUfl., Zaltbommel (2011)</li>
<li>Heemst G., Hedeman H., Bon M. (2006): Project Management Based on PRINCE2, 3rd Edition, 3. Aufl., Van Haren (2005)</li>
<li>Köhler P. (2006): PRINCE2, Heidelberg 2006</li>
</ul>
<br />
<b>Internetquellen</b><br />
<ul>
<li>prince2.com (2012), What is PRINCE2?, URL: http://www.prince2.com/what-is-prince2.asp, Abruf am 29.01.2012</li>
<li>projectsmart (2012), 2009 PRINCE2 Major Revision, URL: http://www.projectsmart.co.uk/history-of-prince2.html, Abruf am 29.01.2012</li>
<li>prince2-deutschland (2012), Verein, URL: http://www.prince2-deutschland.de/content/verein, Abruf am 29.01.2012</li>
<li>copargo (2012), PRINCE2 ist ein "shooting star", URL: http://www.copargo.de/de/downloads/prince2-details/verbreitung, Abruf am 30.01.2012</li>
<li>Google (2012), Trend, URL: Google Trends, http://www.google.com/trends/?q=pmbok,+prince2&ctab=0&geo=all&date=all&sort=0, Abruf am 28.01.2012</li>
<li>XING (2012) , Suche, URL: http://www.xing.com, Abruf am 28.01.2012</li>
</ul>
Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com1tag:blogger.com,1999:blog-7833890125551874480.post-3241223111612269262011-12-13T17:24:00.002+01:002011-12-13T18:03:37.099+01:00Spring Web and SmartGWT integrationWhile working on my current open source project called "openKanban", I got surprised how easy and smooth integration between SmartGWT and Spring Web was.<br />
<br />
<span style="font-size: x-large;">Server (Spring Web)</span><br />
<br />
<span style="font-size: small;">I use standard Spring Web Dispatcher Servlet with some controller on server side, which I register by using a component scan. Hence, this is all I need except a scan entry in the applicationContext.xml:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">BoardController.java (class header)</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[@Controller
@RequestMapping(value = "/board")
public class BoardController {
...
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">To get into action I need a simple Method which is configured by the standard Spring Request Mapping and Request Path Parameter: </span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">BoardController.java (POST method)</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[@RequestMapping(
method = RequestMethod.POST,
value = "{parentBoardId}/activity/add"
)
@ResponseBody
@SecurityInterception
public ActivityDto addActivityToBoard(@PathVariable Long parentBoardId,
ActivityDto activityDto) {
...
}
]]></script></td> </tr>
</table><br />
<span style="font-size: small;">There is nothing special about "@RequestMapping" and "@PathVariable". In combination with the class header mapping annotation it means:</span><br />
<br />
<blockquote class="tr_bq"><span style="font-family: Georgia,"Times New Roman",serif;"> Listen to all HTTP-POST requests that address the rescource: <br />
<code><b>/service/board/[0-n]/activity/add</b></code><br />
take the Parameter <code><b>[0-n]</b></code> out of the Uri and put it into a variable called <code><b>parentBoardId</b></code>.</span></blockquote><span style="font-size: small;"><br />
A little bit more magic comes into play when you watch that method returning a DTO-Object serialized as a JSON String. And that's what SmartGWT or any other requesting client that is calling this method gets. There is no need to configure JSON at any application context. Spring itself checks the classpath and if it finds a JSON serializer, @ResponseBody will return JSON.</span><br />
<span style="font-size: small;"><br />
I do not use Spring Security in openKanban. To keep it small and simple I decided to use the "<a href="http://niklasschlimm.blogspot.com/2011/08/jsr-299-cdi-interceptors-for-spring.html">JSR-299 CDI Interceptors for Spring Bean</a>"-Implementation and run a self-made @SecurityInterception on any controller method to check if the user is authenticated. I will provide more information about this interceptor in a further posting. For now it's enough to know, that every controller method will be checked for authentication.</span><br />
<span style="font-size: small;"><br />
In order to demonstrate SmartGWT DataBinding integration I add another HTTP-GET method example:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">BoardController.java (GET method)</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[@RequestMapping(
method = RequestMethod.GET,
value = "/{parentBoardId}/contact/get"
)
@ResponseBody
@SecurityInterception
public UserDto[] getContacts(@PathVariable Long parentBoardId) {
...
}]]></script></td> </tr>
</table><br />
<span style="font-size: large;">Summary</span><br />
<br />
There are two available rescources:<br />
<ol><li><span style="font-family: Georgia,"Times New Roman",serif;"><code><b>/service/board/[0-n]/activity/add (on POST)</b></code></span></li>
<li><span style="font-family: Georgia,"Times New Roman",serif;"><code><b>/service/board/[0-n]/contact/get (on GET)</b></code></span></li>
</ol>Both will call a method that is returning an "automagically" serialized JSON String.<br />
<br />
<span style="font-size: x-large;">Client (SmartGWT)</span><br />
<br />
<span style="font-size: small;">SmartGWT provides a very versatile communication. The following example will show you what worked really great in the scope of my project. In this context I preferred using two different kinds of request usage:</span><br />
<ol><li>Configurated DataBinding on SmartGWT</li>
<li>Using standard GWT RequestBuilder</li>
</ol><br />
<span style="font-size: large;">Configurated DataBinding on SmartGWT</span><br />
<br />
<span style="font-size: small;">Any SmartGWT widget that implements the interface DataBoundComponent provides a databinding mechanism. In this case it is necessary to define a DataSource, corresponding DataSourceFields and wire it together:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">BoardContactTileGrid.java (constructor)</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[public class BoardContactTileGrid extends TileGrid {
public BoardContactTileGrid() {
setAutoFetchData(true);
setDataSource(new BoardContactDS(getBoardId()));
}
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">TileGrid is a DataBoundComponent. That's why it is possible to add a DataSource. As usual SmartGWT offers you some configurations. This widget will automatically fetch data when the object of the widget is rendered at the client. That means that it is necessary to have a correct DataSource configured at object creation time.</span><br />
<span style="font-size: small;">Let's see what the DataSource looks like:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">BoardContactDS.java (constructor)</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[public class BoardContactDS extends DataSource {
private BoardContactDS(String parentBoardId) {
DataSourceIntegerField userId = new DataSourceIntegerField("userId");
setFields(userId);
setDataFormat(DSDataFormat.JSON);
setDataURL("service/board/" + parentBoardId + "/contact/get");
}
...
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">This is a simple DataSource configuration. After rendering the corresponding widget, an autofetch will trigger a HTTP-GET request to the configured URL. The server response has to be serialized as JSON. We discussed that already in the server section of this posting. It is possible to change the required response to REST, XML or some other custom format. Because I did not need a wsdl contract I decided to use a simple JSON format.</span><br />
<br />
<span style="font-size: large;">Using standard GWT RequestBuilder</span><br />
<br />
<span style="font-size: small;">The com.google.gwt.http.client.RequestBuilder seems powerful but some lines of code are necesarry to get data serialized and send to the server. A request is built in four steps:</span><br />
<ol><li>Creation of RequestBuilder object and passing the HTTP-Method and URL</li>
<li>Configure HTTP-Header</li>
<li>Configure HTTP-Parameters</li>
<li>Send Requests and add a Callback</li>
</ol><span style="font-size: small;">As there are many different requests needed and as they look pretty much the same, abstraction and generic are very helpful in order to reduce duplicate lines of code. So instead of having around 40 LoC on every call I encapsulated it down to this:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">Two lines of Code for a request</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[String contactMail = "stop@hammertime.de";
String id = "42";
PreparedRequest prepReq =
new PreparedRequest(
"user",
"remove",
"contactMail", contactMail,
"id", id
);
prepReq.sendAsyncRequest(new GetKanbansByActivityIdRequestCallback());
]]></script></td> </tr>
</table><br />
<span style="font-size: small;">This leads us to the following request:<br />
<ol><li>uri: service/user/remove/</li>
<li>parameters: contactMail=stop@hammertime.de&id=42</li>
</ol><br />
This works for self defined content as well as for whole objects. </span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">Two lines of code for a request</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[PreparedRequest prepReq =
new PreparedRequest(context, ressource, activityDto);
prepReq.sendAsyncRequest(new UpdateActivityRequestCallback());
]]></script></td> </tr>
</table><br />
<span style="font-size: small;">As you can see I used two ways to wrap all the HTTP stuff. It is either possible to pass static URL parameters or to pass complete Data Transfer Objects (DTO's) to the PreparedRequest to get things done. This has been enabled by using generic typedef, varargs and polymorphism:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">PreparedRequest conctructor for static parameters</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[public PreparedRequest(String contextName,
String ressourceName, String... params) {
this(contextName, ressourceName);
for (int i = 0; i < params.length; i += 2) {
requestParameters.put(params[i], params[i + 1]);
}
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">Java 5 varargs provides flexibility to add as much parameter as I like. The generic DTO to string serialization looks like:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">PreparedRequest conctructor for DTO's</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[public <t extends RequestParameterMap> PreparedRequest(
String contextName,
String ressourceName,
T param) {
this(contextName, ressourceName);
requestParameters.putAll(param.valuesToMap());
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">The PreparedRequest parameter needs to be typed as a subclass of RequestParameterMap. This relationship enables a polymorphic call to the method "valuesToMap()" which has to be implemented by every DTO. </span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">RequestParameterMap</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[public interface RequestParameterMap {
Map<String, String> valuesToMap();
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">For a better understanding find below a simple example of an implementation:</span><br />
<br />
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px;"><tr> <td align="center" style="background-color: #eeeeee; color: #2198a6; font-family: Play, verdana;">ActivityDTO valuesToMap implementation</td> </tr>
<tr><td bgcolor="#000000" height="1px"></td></tr>
<tr><td bgcolor="#FFFFFF"><script class="brush:java" type="syntaxhighlighter"><![CDATA[@Override
public Map<String, String> valuesToMap() {
Map<String, String> activityMap = new HashMap<String, String>();
if (activityId != null) {
activityMap.put("activityId", Long.toString(activityId));
}
activityMap.put("activityName", activityName);
activityMap.put("wipLimit", Integer.toString(wipLimit));
return activityMap;
}]]></script></td> </tr>
</table><br />
<span style="font-size: small;">Although I implemented some level of abstraction, some weak points still remain. If there is a new DTO attribute, it must be added to the valuesAsMap method and there is no "compiletime safety" to make sure it has not been forgotten. Because I could not use Java Reflection API on client side code (remember I am talking about code that is converted to JavaScript), things may get a little bit harsh. Anyway I am still positive about an easy, robust and practicable integration between Spring Web and SmartGWT over HTTP.</span>Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com4tag:blogger.com,1999:blog-7833890125551874480.post-74311637116939023832011-11-19T12:15:00.007+01:002011-12-11T21:43:24.160+01:00Ceylon - Eine neue Sprache für die JVMCeylon befindet sich aktuell in der Entwicklung aber ein Blick auf den Sprachumfang gewährt einem jetzt schon tiefe Einblicke in Konzepte und Funktionsweisen. Außerdem sind Diskussionen und Entscheidungen zu konkreten Elementen der Sprache transparent. Die Ziele der Entwickler von Ceylon sind hoch gesteckt. Nach eigenen Angaben liegt der Fokus von Ceylon auf:<br />
<br />
<ol><li>Eleganz</li>
<li>Lesbarkeit</li>
<li>Typsicherheit</li>
<li>Meta-Programmierung </li>
</ol><br />
Die Programmierung soll wesentlich einfacher sein als mit Java. Besonders in Bereichen von generischer Typsicherheit räumt Ceylon auf. Die Sprache ist mit funktionalen Bestandteilen angereichert, verliert sich aber nicht in verketteten Operationen ohne Seiteneffekte sondern versucht das Beste aus den Welten der Objektorientierung und der funktionalen Programmierung zu vereinen.<br />
<br />
<br />
<div style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: x-large;">Entwicklung </span></div><br />
Aktuell existiert ein Plug-In für Eclipse, sodass diese IDE jetzt schon für Ceylon zur Verfügung steht:<br />
<ul><li>Link zur Installation: <a href="http://ceylon-lang.org/documentation/ide/">http://ceylon-lang.org/documentation/ide/</a> </li>
</ul><br />
Obwohl man bereits einfache Applikationen schreiben kann, stolpert man früh auf kleinere Bugs in der Sprache und Ungereimtheiten in der IDE. Beispielsweise funktioniert das Autoboxing und -unboxing derzeit nicht konsistent.<br />
Derzeit wird kein offizieller Release-Termin für Ceylon veröffentlicht. Konkrete zeitliche Angaben über die Erreichung von Meilensteinen fehlen ebenso. Inhaltlich ist jedoch ausreichend Transparenz vorhanden um sich ausmalen zu können wie zukünftig Ceylon aussehen wird:<br />
<ul><li>Link zur Roadmap: <a href="http://ceylon-lang.org/documentation/roadmap/">http://ceylon-lang.org/documentation/roadmap/</a></li>
</ul><br />
<span style="font-size: x-large;"><span style="font-family: "Trebuchet MS",sans-serif;">Wörterbuch </span></span><br />
<br />
<span style="font-size: small;"><b><span style="font-family: "Courier New",Courier,monospace;">Java Ceylon</span></b></span><br />
<i><span style="font-family: "Courier New",Courier,monospace;">implements satisfies</span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">public shared <span style="font-family: Arial,Helvetica,sans-serif;">(kontextabhängig)</span></span><br style="font-family: "Courier New",Courier,monospace;" /><span style="font-family: "Courier New",Courier,monospace;">protected - </span></i><br />
<div style="font-family: "Courier New",Courier,monospace;"><i>private - <br />
abstract formal<span style="font-family: Arial,Helvetica,sans-serif;"> </span><span style="font-family: Arial,Helvetica,sans-serif;">(Attribute/Methoden)</span></i></div><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: x-large;">Merkmale (Ceylon vs Java)</span><br />
<br />
Im Folgenden habe ich die aus meiner Sicht interessantesten Merkmale von Ceylon zusammengefasst.<br />
<br />
<span style="font-size: large;"><span style="font-family: "Trebuchet MS",sans-serif;">Keine NullPointerException:</span></span><br />
<ul><li>Typsicherheit bei <b><i>null</i></b></li>
<li>Nullwerte sind Inkarnationen der Klasse <b><i>Nothing</i></b></li>
<li>Mögliche null-Werte müssen den Datentyp bei der Deklaration erweitern: <i><b> </b></i></li>
<ul><li style="font-family: "Courier New",Courier,monospace;"><i><b>String? vorname</b></i> <i><b>= "Frank"</b></i></li>
<li><b style="font-family: "Courier New",Courier,monospace;"><i>String|Nothing vorname = "Frank";</i></b><b><i><br />
</i></b></li>
</ul><li>Korrespondierendes exists-Konstrukt</li>
<ul><li><i style="font-family: "Courier New",Courier,monospace;"><b>if (exists vorname) {...}</b></i></li>
</ul></ul><br />
<div style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: large;">Nur ein Zugriffsmodifikator: <i>shared</i></span></div><ul><li>Gültigkeitsbereich von <b style="font-family: "Courier New",Courier,monospace;"><i>shared </i></b>ist dynamisch</li>
<li>Kontextabhängig Funktionsweise</li>
<li>Klassen sind standardmäßig Paketlokal, <i style="font-family: "Courier New",Courier,monospace;"><b>shared </b></i>muss explizit deklariert werden</li>
<li>Eine <b><span style="font-family: "Courier New",Courier,monospace;">shared </span></b>Klasse kann keine Paketlokalen Attribute besitzen</li>
<li>Protected kann nicht abgebildet werden</li>
</ul><br />
<span style="font-size: large;"><span style="font-family: "Trebuchet MS",sans-serif;">Enumerierte Ableitungen:</span></span><br />
<ul><li>Es kann über enumerierte Subtypen eine direkte Verknüpfung der Basisklasse zu der Anzahl der entsprechenden Subtypen hergestellt werden</li>
<li>Dadurch wird zur Compile-Zeit sichergestellt, dass alle Ableitungen in polymorphen Aufrufen explizit im Code behandelt werden </li>
</ul><b> Beispiel:</b><br />
<span style="font-size: small;"><b><span style="font-family: "Courier New",Courier,monospace;">abstract class Tier() of Hund | Katze | Maus { ... }</span></b></span><br />
<span style="font-size: small;"><b><span style="font-family: "Courier New",Courier,monospace;">... </span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;">void sagHallo(Tier tier) {</span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;"> switch (tier)</span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;"> case (is Hund) { //wuff... }</span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;"> case (is Maus) { //pief... }</span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;"> // compile Error: Katze muss ebenfalls behandelt werden</span><br style="font-family: "Courier New",Courier,monospace;" /> <span style="font-family: "Courier New",Courier,monospace;">} </span></b></span><span style="font-family: "Trebuchet MS",sans-serif; font-size: large;"> </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: large;">Attribute:</span><br />
<ul><li>Können einfache Zustände halten</li>
<li>Können getter/setter implizieren ohne sie explizit zu deklarieren </li>
<li>Sind polymorph und überschreibbar</li>
<li>Können in Verbindung mit Closures verwendet werden </li>
</ul><br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: large;">Initialisierung:</span><br />
<br />
<ul><li>Fokus liegt auf einem einheitlichen Initialisierungs Look-And-Feel von Klassenattributen und lokalen Variablen. (anders als in Java)</li>
<li>Keine Konstruktoren, Initialisierung wird aufgeteilt in:</li>
<ul><li>Initialisierungsparameter (werden hinter den Klassennamen geschrieben)</li>
<li>Initialisierungscode wird direkt in die Klasse geschrieben</li>
</ul></ul><br />
Frage: Wie führe ich unterschiedliche Initialisierungen durch z.B. für Testklassen die in Java über den Good Citizen Konstruktor abgebildet werden?<br />
<blockquote class="tr_bq"><span style="font-family: Georgia,"Times New Roman",serif;">"Am Easy to test- all dependent object I use can be passed to me, often in my constructor (typically as Mock Objects)." </span></blockquote><br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: large;">Funktionale Ausrichtung:</span><br />
<ul><li>Klassendeklarationen ähneln eher Methodendeklarationen</li>
<li>Eine Klasse kann auch als eine Funktion verstanden werden welche ein Closure mit den eigenen lokalen Variablen liefert.</li>
</ul><br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: large;">Type Aliase und Type Inferenzen</span><br />
<ul><li>Für lokale Variablen kann der Typ geschlussfolgert werden</li>
<ul><li><b><code class="Brush keyword" style="font-family: "Courier New",Courier,monospace;">value</code><span style="font-family: "Courier New",Courier,monospace;"> <code>tiere </code></span><code class="Brush plain" style="font-family: "Courier New",Courier,monospace;">= </code><code class="Brush color1" style="font-family: "Courier New",Courier,monospace;">LinkedList</code><span style="font-family: "Courier New",Courier,monospace;"> </span><code class="Brush plain" style="font-family: "Courier New",Courier,monospace;">{ </code><code class="Brush string" style="font-family: "Courier New",Courier,monospace;">"Hund"</code><code class="Brush plain" style="font-family: "Courier New",Courier,monospace;">, </code><code class="Brush string" style="font-family: "Courier New",Courier,monospace;">"Katze"</code><code class="Brush plain" style="font-family: "Courier New",Courier,monospace;">, </code><code class="Brush string" style="font-family: "Courier New",Courier,monospace;">"Maus"</code><span style="font-family: "Courier New",Courier,monospace;"> </span><code class="Brush plain" style="font-family: "Courier New",Courier,monospace;">};</code></b><b><span style="font-family: "Courier New",Courier,monospace;"> </span></b></li>
</ul><li>Typedefs sind möglich, sollten aber sparsam verwendet werden</li>
<ul style="font-family: "Courier New",Courier,monospace;"><li><b>interface tiere = List<Tier>;</b></li>
</ul></ul><br />
<span style="font-family: "Trebuchet MS",sans-serif; font-size: large;">High-Order functions</span><br />
<ul><li>Funktionen können andere Funktionen als Parameter entgegen nehmen</li>
<ul><li><b><span style="font-family: "Courier New",Courier,monospace;">void fuettern(Essen essen, void fressen())</span></b></li>
</ul></ul><br />
<div style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: large;">Vereinfachte Generics</span></div><ul><li>Keine Java Wildcards</li>
<li>Keine Raw-Types </li>
<li>Vergegenständlichte Deklaration </li>
</ul><br />
<div style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: large;">Operanden Polymorphismus</span></div><ul><li>Es existiert eine feste Zuordnung von Operanden zu Interfaces</li>
<ul><li> == zu <b><i><span style="font-family: "Courier New",Courier,monospace;">Equality</span></i></b></li>
<li> < zu <i style="font-family: "Courier New",Courier,monospace;"><b>Comparable</b></i></li>
<li>* zu <i style="font-family: "Courier New",Courier,monospace;"><b>Numeric</b></i></li>
</ul></ul><ul><li>Alle Klassen, welche Equality implementieren können mit == verglichen werden</li>
</ul><br />
<br />
<div style="font-family: "Trebuchet MS",sans-serif;"><span style="font-size: x-large;">Fazit</span></div><br />
Die Typsicherheit bei Nullwerten und die Wertsicherheit bei Subklassen sind auf den ersten Blick sehr interessant. Ob die Generics wesentlich einfacher geworden sind, ist meiner Ansicht nach fraglich, da die "<i>declaration-site variance" </i>von Ceylon - Generics um eine neues Konzept erweitert.<br />
Den Ansatz <i><b><span style="font-family: "Courier New",Courier,monospace;">shared </span></b></i>als einzigen Zugriffsmodifikator zu verwenden, betrachte ich ebenfalls skeptisch. In Java ermöglichen <i><b><span style="font-family: "Courier New",Courier,monospace;">public</span></b></i>, <i><b><span style="font-family: "Courier New",Courier,monospace;">protected</span></b></i>, default und <i><b><span style="font-family: "Courier New",Courier,monospace;">private </span></b></i>das Setzen von feineren Nuancen und damit Designabsichten ausdrucksstark zu untermalen. Deshalb geht die gewonnene Dynamik von <i><b><span style="font-family: "Courier New",Courier,monospace;">shared </span></b></i>auf kosten der ausdrucksstarken Lesbarkeit. Der Reflection API von Java stellt Ceylon ein typsicheres Meta-Programmiermodell entgegen, welches ich als weiteres Highlight sehe und für mich die größte Stärke der Sprache bedeutet. So ist es beispielsweise möglich Objektinstanziierungen oder Methodenaufrufe zu "intercepten" ohne Code zu implementieren welcher nach entsprechenden Interecption Annotationen sucht. Das Metamodell von Ceylon erledigt das "out of the box" zur Class-Loading-Time.<br />
<br />
<ul></ul>Frank Hinkelhttp://www.blogger.com/profile/13955542953902898693noreply@blogger.com1