<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5112807191590872205</id><updated>2012-01-17T11:21:00.990+01:00</updated><category term='exceptions'/><category term='osgi'/><category term='android'/><category term='JPF'/><category term='Declarative Services'/><category term='java'/><category term='spring-dm'/><category term='component management'/><category term='DSL'/><category term='programming model'/><category term='abstraction'/><category term='unit testing'/><category term='midp3'/><category term='GITEX'/><category term='class loading'/><category term='modeling'/><category term='language'/><category term='components'/><category term='CBD'/><category term='architecture'/><category term='OO'/><category term='equinox'/><title type='text'>blog::o-&gt;lok</title><subtitle type='html'>Random thoughts (mostly) about component-based and model-driven software development.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-549437590895978481</id><published>2011-03-19T15:13:00.003+01:00</published><updated>2011-03-19T15:21:00.367+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='unit testing'/><category scheme='http://www.blogger.com/atom/ns#' term='JPF'/><title type='text'>Unit testing reloaded: Java Path Finder</title><content type='html'>Unit tests are good. Sometimes we hate them because of the work overhead they require, but almost everyone agree on their usefulness. So the question is: what could we do to eliminate (or at least minimize) this overhead? The answer is quite simple: we should minimize the number of separate unit tests.&amp;nbsp;It is not impossible, since most of the test cases are based on simple assertions, so they can be easily integrated with the source code. In order to do this we need a simple but powerful notation to express the constraints, since assertions scattered across the source statements obscure the code. Annotations are very helpful in this case. We can create annotations for classes and field variables as well as input parameters and return values of operations (we are talking about the&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/Design_by_contract"&gt;design by contract&lt;/a&gt; idiom).&lt;br /&gt;Defining annotations is easy, but it is very time consuming to write a processor for the processing of the statements written in these annotations. Fortunately, we do not have to implement anything, we can use the &lt;a href="http://babelfish.arc.nasa.gov/trac/jpf/wiki"&gt;Java Path Finder&lt;/a&gt;.&amp;nbsp;Its&amp;nbsp;&lt;a href="http://babelfish.arc.nasa.gov/trac/jpf/wiki/projects/jpf-aprop/"&gt;jpf-aprop&lt;/a&gt;&amp;nbsp;module fully &lt;a href="http://babelfish.arc.nasa.gov/trac/jpf/wiki/projects/jpf-aprop/contract"&gt;supports&lt;/a&gt; the design by contract idiom.&lt;br /&gt;JPF is a real multi-purpose tool, and it has a moderate learning curve. Unfortunately, the online documentation is a bit outdated, but there are many publications and examples that can be downloaded from the site, so an average Java programmer can use the tool without difficulties.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-549437590895978481?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/549437590895978481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=549437590895978481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/549437590895978481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/549437590895978481'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2011/03/unit-testing-reloaded-java-path-finder.html' title='Unit testing reloaded: Java Path Finder'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1414904366083142477</id><published>2010-12-24T22:17:00.011+01:00</published><updated>2010-12-25T21:38:29.419+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='OO'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>More powerful type casts?</title><content type='html'>Long time without a single post... Sorry, I've been very busy this year. &lt;br /&gt;There is an interesting discussion about a new, Java-like language in the &lt;a href="http://harmony.apache.org/mailing.html"&gt;Apache Harmony developers' mailing list&lt;/a&gt;. Yesterday someone proposed a new language feature, a more powerful type cast that provides direct access to the overridden methods of parent classes. Lets see an example:&lt;br /&gt;&lt;blockquote&gt;class Foo {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void foo() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Bar extends Foo {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void foo() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;/blockquote&gt;As seen, we have two classes, &lt;i&gt;Foo&lt;/i&gt; and &lt;i&gt;Bar&lt;/i&gt;. &lt;i&gt;Bar&lt;/i&gt; extends &lt;i&gt;Foo&lt;/i&gt; and overrides the method &lt;i&gt;foo()&lt;/i&gt; declared in its parent.&lt;br /&gt;&lt;blockquote&gt;Bar bar = new Bar();&lt;br /&gt;bar.foo();&lt;/blockquote&gt;If we instantiate &lt;i&gt;Bar&lt;/i&gt;, and call &lt;i&gt;foo()&lt;/i&gt;, the runtime will execute the method &lt;i&gt;foo() &lt;/i&gt;declared in &lt;i&gt;Bar&lt;/i&gt;. The proposed feature looks like a normal type cast&lt;br /&gt;&lt;blockquote&gt;((Foo strong) bar).foo();&lt;/blockquote&gt;but forces the runtime to execute the method &lt;i&gt;foo()&lt;/i&gt; declared in &lt;i&gt;Foo&lt;/i&gt; instead of &lt;i&gt;Bar.foo()&lt;/i&gt;.&lt;br /&gt;At first sight, this feature seems harmless, but at next, it is a potential disaster. If the runtime allows this, it may cause serious side-effects, if the overriding method contains code that changes the state of the instance. Moreover, the overridden method may not be designed to be called from the given context, so any developer could (even unintentionally) break the design rules of any API by a simple type cast. &lt;br /&gt;On the other side, I do not see any advantages of the proposed feature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1414904366083142477?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1414904366083142477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1414904366083142477' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1414904366083142477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1414904366083142477'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2010/12/more-powerful-casting.html' title='More powerful type casts?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-8966271211563962483</id><published>2009-12-17T16:44:00.000+01:00</published><updated>2009-12-17T17:11:32.184+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><category scheme='http://www.blogger.com/atom/ns#' term='exceptions'/><title type='text'>Runtime exceptions: the good, the bad and the ugly #1</title><content type='html'>Reading others' source code is useful, but sometimes very annoying. Programmers often code routinely and this may lead to subtle but evil mistakes. Handling null references is a good example. I often the following piece of code:&lt;br /&gt;&lt;blockquote&gt;if ("foo".equals(bar)) {&lt;br /&gt; doSometing();&lt;br /&gt;}&lt;/blockquote&gt;This kind of expression can be useful in cases when &lt;span style="font-style: italic;"&gt;bar&lt;/span&gt; is allowed to be null, and we don't want to write an explicit check for it. But it should not be used when &lt;span style="font-style: italic;"&gt;bar&lt;/span&gt; should not be null, because it eliminates a NullPointerException and no one will know about the error until the first failure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-8966271211563962483?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/8966271211563962483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=8966271211563962483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/8966271211563962483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/8966271211563962483'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2009/12/exceptions-good-bad-and-ugly.html' title='Runtime exceptions: the good, the bad and the ugly #1'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-8045476715992729199</id><published>2009-11-20T09:44:00.000+01:00</published><updated>2009-11-25T21:14:38.890+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Declarative Services'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='programming model'/><title type='text'>Programming Model for OSGi DS</title><content type='html'>For most of the applications, the use of &lt;a href="http://www.osgi.org/"&gt;OSGi&lt;/a&gt; Declarative Services for wiring components is more effective than the traditional lookup-based methods. But if we think about the programming model, there are some questions that need to be answered.&lt;br /&gt;First, we have to decide, how to describe our components. We can choose between the standard way (XML descriptors referenced by the &lt;span style="font-style: italic;"&gt;Service-Component&lt;/span&gt; property of the OSGi manifest) and Java annotations (requires a &lt;a href="http://eclipse.dzone.com/articles/annotations-osgi-declarative"&gt;3rd party API&lt;/a&gt;).&lt;br /&gt;XML descriptors are great things, we can declare the provided and required interfaces of our components as well as their configuration properties and factories for instantiating more than one component of the same type. Nice and intuitive, but it comes with certain cost: we have to duplicate information (component and interface declarations, bind methods). This may lead to programming mistakes causing runtime errors like uninitialized components, null references, etc.&lt;br /&gt;We can prevent duplication by annotating our Java classes with all the information the classes do not contain. We can mark provided interfaces and bind/unbind methods. Additionally, we have to provide ways for storing component configuration. For this task, we can use something like the Preferences Service or the Configuration Admin Service.&lt;br /&gt;Using annotations, we can minimize the number of program faults caused by missing or inconsistent component descriptions.&lt;br /&gt;As long as we are allowed to use annotations, this solution could be better. But be aware, annotations are polluting the POJO model, because of the coupling between the annotation API and our component.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-8045476715992729199?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/8045476715992729199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=8045476715992729199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/8045476715992729199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/8045476715992729199'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2009/11/programming-model-for-osgi-ds.html' title='Programming Model for OSGi DS'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-7211339643071756053</id><published>2008-11-08T14:10:00.000+01:00</published><updated>2008-11-10T12:58:03.011+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='components'/><category scheme='http://www.blogger.com/atom/ns#' term='abstraction'/><title type='text'>OSGi - Why do we need it?</title><content type='html'>I heard this question many times. I usually reply quickly in a few sentences, but I agree that &lt;a href="http://www.osgi.org/"&gt;OSGi&lt;/a&gt; deserves a more detailed answer.&lt;br /&gt;Let's start with the basics. The &lt;a href="http://java.sun.com/docs/books/jls/"&gt;Java Language Specification&lt;/a&gt; does not mention higher-level abstractions, like components. It follows the &lt;a href="http://en.wikipedia.org/wiki/Object-oriented_programming"&gt;OO concepts&lt;/a&gt;, in which the highest level of abstraction is the class. Why is it important? There is a difference between a class and a component. A component specifies its provided and required interfaces, while a class is not able to do it. Of course, a class can contain public members that implicitly form a provided interface together (and we can extract them into a Java interface to make things more clear), but it is not a formal specification of a provided interface. Specifying the required interface is more problematic, it can only be extracted from the class using static analysis. It is far from being a formal specification, too.&lt;br /&gt;This 'minor' weakness of the language makes real component-based development impossible without building an additional abstraction level at the top of classes and interfaces. We can call it a component model.&lt;br /&gt;At the very beginning, Sun specified one called &lt;a href="http://java.sun.com/javase/technologies/desktop/javabeans/index.jsp"&gt;JavaBeans&lt;/a&gt;, but it was too simplistic and it was intended for building graphical user interfaces, not complex systems.&lt;br /&gt;As Java became a mainstream language, complex tasks required sophisticated component models. It was the time when &lt;a href="http://java.sun.com/products/ejb/"&gt;EJB&lt;/a&gt; was born. At the same time, many projects (&lt;a href="http://www.springsource.org/about"&gt;Spring&lt;/a&gt;, &lt;a href="http://www.picocontainer.org/"&gt;PicoContainer&lt;/a&gt;, etc.) tried to address the same need in a lightweight fashion, but they all have two common problems: handling versioning and dynamic loading at component-level.&lt;br /&gt;As the internet-boom was over, EJB lost popularity because of its complexity and price (application servers were very expensive at this time), and lightweight frameworks became more popular. OSGi was created at this time to address the same need, but it treated components as first-class entities (they called them bundles). This resulted in a complete component model that made component-based development possible. Furthermore, OSGi defines standard services, like logging, package management, etc. that simplifies the job of developers not wanting to reinvent the wheel.&lt;br /&gt;There are some important consequences of having a good component model. First, a well-written component is reusable. With the introduction of component versioning, runtime library conflicts (JAR hell) can be eliminated. Second, component instances can provide services and this, together with dynamic component loading and component-level dependency management makes service composition possible.&lt;br /&gt;To wrap it up: OSGi is a natural extension of Java, because of the nice component model and its dynamic nature. We really needed it for years when we were forced to manually handle all of the problems solved by OSGi in each and every project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-7211339643071756053?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/7211339643071756053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=7211339643071756053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/7211339643071756053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/7211339643071756053'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/11/osgi-why-do-we-need-it.html' title='OSGi - Why do we need it?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1226125132208275078</id><published>2008-10-27T11:17:00.000+01:00</published><updated>2008-11-08T23:07:58.527+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GITEX'/><title type='text'>GITEX impressions</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_Doh98X5vMYw/SQWrIXcHnZI/AAAAAAAAABU/AwddBkBVKr4/s1600-h/dscf0311.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 240px; height: 320px;" src="http://4.bp.blogspot.com/_Doh98X5vMYw/SQWrIXcHnZI/AAAAAAAAABU/AwddBkBVKr4/s320/dscf0311.jpg" alt="" id="BLOGGER_PHOTO_ID_5261799899871550866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.gitex.com/"&gt;GITEX&lt;/a&gt; was finished last week. We were there as exhibitors to make our company's NFC-based products more popular. I think we were quite successful in it, but it's not what I want to say. I want to talk about a few interesting observations I made.&lt;br /&gt;Perhaps the most important of these is related to the way we do presentations.&lt;br /&gt;I had to get experienced that conventional demos are not very effective in exhibitions where we only have few seconds to raise interest. Forget about slides filled with textual information. Present an idea that can be visualized; a picture, a movie or a diagram, with only a few words. Remember the old saying "A picture is worth a thousand words."&lt;br /&gt;My second thought is about documentation and brochures. Very few people want to read long descriptions, no matter how useful they are. Prepare a very short overview section in which you write about the most important things you want to express. In case you have more to say, the next section can contain more details. Then, at the end of the document, you may summarize the most important things once again in a separate section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1226125132208275078?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1226125132208275078/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1226125132208275078' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1226125132208275078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1226125132208275078'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/10/gitex-impressions.html' title='GITEX impressions'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Doh98X5vMYw/SQWrIXcHnZI/AAAAAAAAABU/AwddBkBVKr4/s72-c/dscf0311.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-6819333818789432027</id><published>2008-04-15T11:33:00.000+02:00</published><updated>2008-04-28T15:08:43.791+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='abstraction'/><title type='text'>Architecture diagrams, once again</title><content type='html'>A few months before, I wrote a blog entry about architecture diagrams. I mentioned that UML can be used for describing architectural concepts, but I didn't write too much about that. Perhaps it was a mistake, because you might think, that UML is a good choice for these kind of tasks. Bu it's not.&lt;br /&gt;To describe an architecture, we need a way to describe entire systems, not just components and connections. UML has deployment diagram, of course, but it lacks well-defined semantic meaning behind diagram elements. It means, that a deployment diagram is not an unambiguous description of a system, since different people assign different meaning to the elements of a diagram.&lt;br /&gt;There are some more formal approaches, like &lt;a href="http://www.fmc-modeling.org/"&gt;FMC&lt;/a&gt; (Fundamental Modeling Concepts). Its concepts are nice and well-founded, but only a few people use it, unfortunately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-6819333818789432027?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/6819333818789432027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=6819333818789432027' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6819333818789432027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6819333818789432027'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/04/architecture-diagrams-once-again.html' title='Architecture diagrams, once again'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1748410067672844097</id><published>2008-03-29T12:07:00.000+01:00</published><updated>2008-03-29T22:04:54.159+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DSL'/><category scheme='http://www.blogger.com/atom/ns#' term='modeling'/><title type='text'>Textual DSLs and diagrams</title><content type='html'>While it seems fairly trivial to generate the graphical representation of a model built using a textual DSL, many people (including me, until now) do these two steps (modeling and diagramming) separately. Perhaps they don't know about tools that can greatly simplify this task like &lt;a href="http://www.graphviz.org/"&gt;Graphwiz&lt;/a&gt;. It is really a very nice tool. Using a simple textual DSL provided by the tool for diagramming, wide range of graphs can be generated, even very complex ones. Lets see a concrete example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;digraph Components {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Container [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Component [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Port [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Service [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  RequiredService [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ProvidedService [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Interface [shape="box"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Container -&gt; Component [label="manages", headlabel="*", arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Component -&gt; Port [label="has", headlabel="*", arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Component -&gt; ProvidedService [label="provides", headlabel="*", arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Component -&gt; RequiredService [label="requires", headlabel="*", arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  ProvidedService -&gt; Service [arrowhead="empty"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  RequiredService -&gt; Service [arrowhead="empty"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Port -&gt; RequiredService [label="points to", headlabel="*",    arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  Service -&gt; Interface [label="defined by", arrowhead="open"];&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and &lt;a href="http://www.ngms.hu/sragli/blog/component_model.gif"&gt;here is&lt;/a&gt; the generated diagram.&lt;br /&gt;So my point is, that (with minor modifications on the templates used for code generation) nice diagrams can be generated; there is no need to use a separate diagramming tool for these kind of tasks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1748410067672844097?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1748410067672844097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1748410067672844097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1748410067672844097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1748410067672844097'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/textual-dsls-and-diagrams.html' title='Textual DSLs and diagrams'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-6104761284032984695</id><published>2008-03-27T01:36:00.000+01:00</published><updated>2008-03-27T11:00:40.911+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='components'/><title type='text'>Components and Java classes</title><content type='html'>People often misuse words that have a well-defined meaning. This is the case with the word "component" which is often used as a synonym for a Java class. In reality, these artifacts are very different. Component is an architectural concept whereas the Java class is an implementation artifact that can be part of the programming model, but might not be used in the conceptual architecture. Moreover, the Java language has no notion of component, so components can poorly be represented using only the elements of the language, without annotations or external configuration (but remember, these are not part of the language, only extensions to it).&lt;br /&gt;Let me explain that briefly. Components should express their inter-dependencies, so every component has to declare its provided interface and required interface (these are not Java interfaces, only architectural level concepts).&lt;br /&gt;In Java, a class can declare its provided interfaces (these are the implemented interfaces), but can't declare its required interfaces explicitly, since there is no language element for it. Only implicit declaration is possible, but it may not be enough if we want to express component dependencies in the programming model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-6104761284032984695?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/6104761284032984695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=6104761284032984695' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6104761284032984695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6104761284032984695'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/componens-and-java-classes.html' title='Components and Java classes'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-6266120444837855411</id><published>2008-03-20T20:09:00.000+01:00</published><updated>2008-03-20T20:26:56.314+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='components'/><title type='text'>JUM 6</title><content type='html'>The 6th &lt;a href="http://www.jum.hu/"&gt;JUM&lt;/a&gt; meeting has been held yesterday. There were two presentation about appservers and Flex, and I gave a talk about Java component models. I talked briefly about the basics (component, component model, component framework, Dependency Injection, Dependency Lookup) and about some concrete component models and frameworks (SCA, Spring, OSGi, Guice,  JSR277) and their interoperability (Spring-DM, Guice-OSGi, Guice-Spring). Here are the &lt;a href="http://www.ngms.hu/sragli/talks/Java%20komponens%20modell.ppt"&gt;slides&lt;/a&gt; (only in Hungarian).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-6266120444837855411?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/6266120444837855411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=6266120444837855411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6266120444837855411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6266120444837855411'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/jum-6.html' title='JUM 6'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-3959654355957970635</id><published>2008-03-12T00:36:00.000+01:00</published><updated>2008-03-16T15:44:02.590+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='OO'/><title type='text'>Dumb value objects</title><content type='html'>What sometimes really bothers me is that many programmers overuse value objects. They do it despite the fact that this concept is over-simplified for many tasks. And they even implement the accessors as dumb wrappers around the values, leave the checking of values for the callers, which is mostly a silly thing.&lt;br /&gt;My point is that we should talk more about this kind of design. My 10 cents:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Read about &lt;a href="http://en.wikipedia.org/wiki/Business_object_%28computer_science%29"&gt;domain objects&lt;/a&gt; and try to understand the concept. It's easy.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you need value objects, implement their accessors in a way to check the accessed values and throw exceptions (in Java, I prefer runtime exceptions such as IllegalArgumentException or IllegalStateException) if the pre-defined constraints are not satisfied.&lt;/li&gt;&lt;li&gt;Think about concepts at higher abstraction level than data (objects, components etc), before you implement things.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-3959654355957970635?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/3959654355957970635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=3959654355957970635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/3959654355957970635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/3959654355957970635'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/pojo-value-object.html' title='Dumb value objects'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-7026496870475578088</id><published>2008-03-07T01:45:00.000+01:00</published><updated>2008-03-12T01:55:31.969+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='components'/><title type='text'>Podcast about software components</title><content type='html'>The guys at &lt;a href="http://www.se-radio.net/"&gt;Software Engineering Radio&lt;/a&gt; have recorded a very good &lt;a href="http://www.se-radio.net/podcast/2008-02/episode-87-software-components"&gt;podcast&lt;/a&gt; about software components and component-based architectures. It's worth to listen to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-7026496870475578088?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/7026496870475578088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=7026496870475578088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/7026496870475578088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/7026496870475578088'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/podcast-about-software-components.html' title='Podcast about software components'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1575171355663160236</id><published>2008-03-01T12:19:00.000+01:00</published><updated>2008-03-05T19:28:22.208+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>Architecture, again</title><content type='html'>Last time I blogged about architectural diagrams. Now, a very good &lt;a href="http://www.infoq.com/articles/architecture-as-language-a-story"&gt;article&lt;/a&gt; appeared on &lt;a href="http://www.infoq.com/"&gt;InfoQ&lt;/a&gt; from &lt;a href="http://www.voelter.de/"&gt;Markus Völter&lt;/a&gt;. In the article he is focusing on the creation of a language used to describe a conceptual architecture and provides an overview about DSLs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1575171355663160236?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1575171355663160236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1575171355663160236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1575171355663160236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1575171355663160236'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/03/architecture-again.html' title='Architecture, again'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-2826101061142374623</id><published>2008-01-30T15:36:00.000+01:00</published><updated>2008-03-01T13:08:20.644+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>Bad style - Architecture Diagrams</title><content type='html'>Plain boxes linked with each other using lines; these kind of diagrams are fine to explain many things - until they are called "architecture". It is a wide-spread misconception, they are just plain diagrams, until they meet the requirements of an architecture diagram. But wait a minute. What are these requirements?&lt;br /&gt;There are many definitions of software architecture. I don't want to go into the details of software architectures, many people did this before (read the &lt;a href="http://www.amazon.com/s/ref=nb_ss_w/303-6465264-5982648?__mk_de_DE=%C5M%C5Z%D5%D1&amp;amp;initialSearch=1&amp;amp;url=search-alias%3Daps&amp;amp;field-keywords=Pattern-Oriented+Software+Architecture+"&gt;POSA books&lt;/a&gt; or &lt;a href="http://www.sei.cmu.edu/architecture/index.html"&gt;this&lt;/a&gt;, &lt;a href="http://www.voelter.de/data/pub/ArchitecturePatterns.pdf"&gt;this &lt;/a&gt;and &lt;a href="http://stal.blogspot.com/2007/11/what-is-software-architecture.html"&gt;this&lt;/a&gt;). Instead, I'd like to discuss some of the most important properties of good architecture diagrams.&lt;br /&gt;The first is an unambiguous language (in this case, graphical notations, but the &lt;a href="http://www.sei.cmu.edu/architecture/adl.html"&gt;architecture description&lt;/a&gt; can be textual as well) the architecture is expressed in. Completeness (remember: &lt;span style="font-style: italic;"&gt;component&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;interface&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;connector&lt;/span&gt;, &lt;span style="font-style: italic;"&gt;configuration&lt;/span&gt;) is also important. This language should be well-defined with respect to its syntax (the set of notations used) and semantics (the meaning of the notations and language constructs).&lt;br /&gt;It can be very helpful if the graphical notations of the language are based on well-known graphical notations, such as the elements of UML component or class diagrams.&lt;br /&gt;The diagrams must reflect the architectural decisions (which are based on requirements, of course) and they should be organized around architectural aspects and/or viewpoints. This is the most important thing.&lt;br /&gt;The layout of diagrams should emphasize the &lt;span style="font-style: italic;"&gt;architectural configuration&lt;/span&gt;. Position and connections of each element in every diagram should be in sync with the architecture. For example, a diagram should not show layers or partitions where they don't exist.&lt;br /&gt;And that's enough for start. If a diagram is made with these things in mind, it is an architecture diagram.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-2826101061142374623?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/2826101061142374623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=2826101061142374623' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2826101061142374623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2826101061142374623'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/01/bad-style-architecture-diagrams.html' title='Bad style - Architecture Diagrams'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-5511699749238227223</id><published>2008-01-24T10:28:00.000+01:00</published><updated>2008-01-25T00:41:15.040+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='class loading'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>OSGi and DynamicImport-Package</title><content type='html'>Last week I refactored an old Spring-based application to be OSGi-based. First I created some bundles of it. It was a pleasure, I really like the Eclipse plug-in development tools, but it's not what I want to talk about.&lt;br /&gt;One of the classes from the legacy app used dynamic class loading via Class.forName().  This class was a factory used to load other classes reside in many bundles. It is perfectly legal, but in order to load a class, the class loader of the bundle must be able to find it. This can be done nicely with "&lt;span style="font-style: italic;"&gt;Import-Package: package.of.the.class.to.be.loaded&lt;/span&gt;". Of course, someone must export this package using &lt;span style="font-style: italic;"&gt;Export-Package&lt;/span&gt;. But what happens when the factory class is referenced from the bundle exported that package? The answer is simple: circular dependency. You may say that it is a non-issue and can be solved easily using&lt;span style="font-style: italic;"&gt; DynamicImport-Package&lt;/span&gt;, but lets think about that for a moment. What are the architectural consequences of such a decision?&lt;br /&gt;Importing a package means you are about to create dependency to the bundle exporting that package. So even if your importing bundle works perfectly fine without the other (exporter) bundle, the exporter must also be deployed in order to satisfy the dependency.&lt;br /&gt;Moreover, exporting means that you expose internals of the exporter bundle that are not part of the service's API provided by this bundle. By doing this, you may experience compatibility issues when you change the internals of this bundle in the future, even if the service API remains the same.&lt;br /&gt;With the above in mind, I decided to refactor the affected bundles to eliminate circular dependency instead of just "work around" the problem using &lt;span style="font-style: italic;"&gt;DynamicImport-Package.&lt;br /&gt;&lt;/span&gt;To wrap it up: I suggest you to think about the architecture first and use &lt;span style="font-style: italic;"&gt;DynamicImport-Package&lt;/span&gt; if you really need it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-5511699749238227223?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/5511699749238227223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=5511699749238227223' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5511699749238227223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5511699749238227223'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/01/osgi-and-dynamicimport-package.html' title='OSGi and DynamicImport-Package'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-2052158791685764318</id><published>2008-01-14T18:42:00.000+01:00</published><updated>2008-01-14T20:36:34.937+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='class loading'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>OSGi and the infamous class loading problems</title><content type='html'>I just fought my fight with OSGi and &lt;a href="http://commons.apache.org/logging/"&gt;JCL&lt;/a&gt; (Jakarta Commons Logging). I was porting an old Spring-based app to OSGi+&lt;a href="http://www.springframework.org/osgi/"&gt;Spring-DM&lt;/a&gt;, so I tried to use commons logging in my bundles. This ended up getting a nice exception:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;org.apache.commons.logging.LogConfigurationException:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;java.lang.NoClassDefFoundError (Caused by&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;java.lang.NoClassDefFoundError)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So I refactored all of my bundles to use the OSGi &lt;a href="http://www2.osgi.org/javadoc/r4/org/osgi/service/log/LogService.html"&gt;LogService&lt;/a&gt; instead of JCL. Re-deploy, start ... and no change. After some googling I found an &lt;a href="http://www.qos.ch/logging/classloader.jsp"&gt;interesting article&lt;/a&gt; which explained that JCL uses a custom class loading scheme which does not cause problems in standalone applications, but shows this weird behaviour under an OSGi environment. The article pointed to another logging framework (&lt;a href="http://www.slf4j.org/"&gt;SLF4J&lt;/a&gt;) which provided a nice solution for the problem. A few lines from my config.ini:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;jcl104-over-slf4j-1.4.3.jar@start,\&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;slf4j-simple-1.4.3.jar@start,\&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;slf4j-api-1.4.3.jar@start,\&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And that's all. So please do not use JCL unless you want to bang your head against the wall.&lt;br /&gt;&lt;br /&gt;(This madness drove me to an OSGi-related rule of thumb: if something looks suspicious around your bundles and you have no idea what's wrong, you may have a class loading issue.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-2052158791685764318?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/2052158791685764318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=2052158791685764318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2052158791685764318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2052158791685764318'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2008/01/osgi-and-infamous-class-loading.html' title='OSGi and the infamous class loading problems'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-2802196410987436534</id><published>2007-12-23T13:11:00.000+01:00</published><updated>2007-12-24T13:05:22.417+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>Java closures one more time</title><content type='html'>There is a heating debate on proposed language extensions, but the most debated is closures of course. Most people agree that the idea is great, but they cannot agree on the proposed implementations. I think the question is more conceptional. Java is not designed to be a functional language, so I doubt that these constructs can seamlessly be integrated into the language. So first we should discuss the benefits of this extension and if the benefits are much bigger than the drawbacks (increased complexity, more possibilities for code obfuscation and subtle mistakes) then we can talk about the implementation details. And if there are more drawbacks, we should throw the idea away and use a functional programming language (like Scala) for the appropriate tasks.&lt;br /&gt;Personally, I do not think that Java has to follow the same path as C++. Using multiple languages on the same platform (JVM) is much more painless today as it has been in the past. Just think about the multi-language IDEs like Eclipse or NetBeans.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-2802196410987436534?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/2802196410987436534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=2802196410987436534' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2802196410987436534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/2802196410987436534'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/java-closures-one-more-time.html' title='Java closures one more time'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-767178958754644640</id><published>2007-12-22T17:20:00.000+01:00</published><updated>2008-01-14T20:50:42.570+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='equinox'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='spring-dm'/><title type='text'>Equinox with Spring-DM</title><content type='html'>I've just tried to deploy an &lt;a href="http://www.eclipse.org/equinox/"&gt;Equinox&lt;/a&gt; framework with &lt;a href="http://www.springframework.org/osgi/"&gt;Spring-DM&lt;/a&gt; first time. I thought it will be much more difficult (Spring-DM is only RC1), but in reality it is very easy. First I set up a basic Equinox. Then I copied the JARs belonging to the Spring-DM into the &lt;span style="font-style: italic;"&gt;plugins&lt;/span&gt;/ directory and created a &lt;span style="font-style: italic;"&gt;config.ini&lt;/span&gt; that contains the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;eclipse.ignoreApp=true&lt;br /&gt;eclipse.consoleLog=true&lt;br /&gt;osgi.clean=true&lt;br /&gt;osgi.console=&lt;br /&gt;osgi.bundles=org.eclipse.equinox.common@2:start,\&lt;br /&gt;org.eclipse.equinox.registry_3.4.0.v20071203.jar@3:start,\&lt;br /&gt;org.eclipse.osgi.services_3.1.200.v20071203.jar@3:start,\&lt;br /&gt;org.eclipse.equinox.log_1.1.0.v20071203.jar@3:start,\&lt;br /&gt;org.eclipse.osgi.util_3.1.200.v20071203.jar@3:start,\&lt;br /&gt;jcl104-over-slf4j-1.4.3.jar@start,\&lt;br /&gt;slf4j-simple-1.4.3.jar@start,\&lt;br /&gt;slf4j-api-1.4.3.jar@start,\&lt;br /&gt;aopalliance.osgi-1.0-SNAPSHOT.jar@start,\&lt;br /&gt;cglib-nodep.osgi-2.1.3-SNAPSHOT.jar@start,\&lt;br /&gt;spring-aop-2.5.jar:start,\&lt;br /&gt;spring-beans-2.5.jar:start,\&lt;br /&gt;spring-context-2.5.jar:start,\&lt;br /&gt;spring-core-2.5.jar:start,\&lt;br /&gt;spring-osgi-io-1.0-rc1.jar:start,\&lt;br /&gt;spring-osgi-core-1.0-rc1.jar:start,\&lt;br /&gt;spring-osgi-extender-1.0-rc1.jar:start&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;and voilà!&lt;a href="http://dict.leo.org/frde?lp=frde&amp;amp;p=eL4jU.&amp;amp;search=voil%E0"&gt;&lt;b&gt;&lt;/b&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-767178958754644640?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/767178958754644640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=767178958754644640' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/767178958754644640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/767178958754644640'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/equinox-with-spring-dm.html' title='Equinox with Spring-DM'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1185337724857825805</id><published>2007-12-17T15:11:00.000+01:00</published><updated>2007-12-17T15:18:00.561+01:00</updated><title type='text'>Fun for boring mondays...</title><content type='html'>I just found: &lt;a href="http://blogoscoped.com/archive/2007-12-10-n70.html"&gt;&lt;span style="text-decoration: underline;"&gt;Monsters of the Programming World&lt;/span&gt;&lt;/a&gt;. I am thinking about making a T-shirt...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1185337724857825805?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1185337724857825805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1185337724857825805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1185337724857825805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1185337724857825805'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/fun-for-boring-mondays.html' title='Fun for boring mondays...'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-496008788825443441</id><published>2007-12-15T17:55:00.002+01:00</published><updated>2007-12-23T13:10:35.309+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='CBD'/><title type='text'>JavaPolis - CBD</title><content type='html'>Component-Based Software Development is going to mainstream, finally. This is my conclusion based on my experiences from JavaPolis. I've seen good presentations from Bob Lee (author of &lt;a href="http://code.google.com/p/google-guice/"&gt;Guice&lt;/a&gt;) and Peter Kriens who talked about &lt;a href="http://www.osgi.org/"&gt;OSGi&lt;/a&gt;. Moreover, &lt;a href="http://www.springframework.org/"&gt;Spring&lt;/a&gt;, EJB3 and component-based web development were mentioned in many presentations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-496008788825443441?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/496008788825443441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=496008788825443441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/496008788825443441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/496008788825443441'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/javapolis-cbd.html' title='JavaPolis - CBD'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1389520238233163338</id><published>2007-12-15T12:17:00.000+01:00</published><updated>2007-12-17T12:36:48.523+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>JavaPolis - closures</title><content type='html'>In the second conference day, Josh Bloch talked about closures. He provided an overview about the &lt;a href="http://www.javac.info/"&gt;BGGA specification&lt;/a&gt; then he talked about his opinion. He basically thinks the same as &lt;a href="http://blog-o-lok.blogspot.com/2007/09/closures-and-java.html"&gt;me&lt;/a&gt;. Closures are nice (I really love declarative constructs!),  if they are integrated seamlessly to the language, but the changes proposed by this spec are too intrusive. The most important concept behind the Java language is readability and closures will have a negative impact on it if they will be implemented this way.&lt;br /&gt;He also talked about &lt;a href="http://docs.google.com/View?docid=k73_1ggr36h"&gt;his proposal&lt;/a&gt;. It is more lightweight compared to BGGA, but far from seamless as it breaks the existing rules of the language (e.g. allows writing code blocks without  enclosing methods - OK, I know, it is only a syntactic sugar).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1389520238233163338?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1389520238233163338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1389520238233163338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1389520238233163338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1389520238233163338'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/javapolis-closures.html' title='JavaPolis - closures'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-5846340392312329423</id><published>2007-12-03T15:00:00.000+01:00</published><updated>2007-12-03T19:32:03.365+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='abstraction'/><title type='text'>Use the right level of abstraction</title><content type='html'>We are humans (most of us, I think), so we have our limits. To deal with them, we created a world of abstractions. Abstractions are so important we cannot live without them. We use them in our daily routine, they help us communicate things effectively or to do a wide variety of things.&lt;br /&gt;However, humans make mistakes. Every time. Not using abstractions to solve or to communicate complex things is one of them, but a more severe mistake is to mix concepts from different levels of abstraction.&lt;br /&gt;In my work, I am often facing this kind of problems. People describe a conceptual architecture and use technology-specific terms like web services, JavaEE, AJAX, for example. It is not only disturbing, it takes precious time and effort to clarify our concepts unless they lead to wrong architectural and business decisions.&lt;br /&gt;Abstractions are our friends. Use them appropriately.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-5846340392312329423?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/5846340392312329423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=5846340392312329423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5846340392312329423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5846340392312329423'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/12/use-right-level-of-abstraction-please.html' title='Use the right level of abstraction'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1276314816740546030</id><published>2007-11-26T13:05:00.000+01:00</published><updated>2007-12-15T17:46:08.994+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>More on Android and OSGi</title><content type='html'>As I wrote in one of my previous posts, Android is not a Java platform. However, it is "Java-like" enough to &lt;a href="http://blog.luminis.nl/luminis/entry/osgi_on_google_android_using"&gt;manage to get OSGi on it&lt;/a&gt;. I am happy to see this kind of experimentation, because I seriously think that OSGi has a potential to bring the concept of component orientation into the mobile area.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1276314816740546030?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1276314816740546030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1276314816740546030' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1276314816740546030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1276314816740546030'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/11/more-on-android-and-osgi.html' title='More on Android and OSGi'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-6045278648014687326</id><published>2007-11-12T23:36:00.000+01:00</published><updated>2007-12-15T17:45:58.929+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Google Android - is it the way to go?</title><content type='html'>Yesterday Google has released an early access version of the Android SDK. For the first look, it is nice. It is Java-compatible (at least on source level) and it has a component model. Its API looks well-thought.&lt;br /&gt;However, there is a big problem with it: compatibility. Android's Dalvik VM is not a Java VM. Its byte code is not Java byte code.  It uses different packaging conventions, and so on. Therefore, if Android will be successful, mobile application developers have to deal with at least two totally different platforms.&lt;br /&gt;I agree that CDC/CLDC and MIDP have several weaknesses and MIDP does not have a component model. But these problems can be addressed in a standard way (see &lt;a href="http://www.jcp.org/en/jsr/detail?id=232"&gt;JSR232&lt;/a&gt; or &lt;a href="http://www.jcp.org/en/jsr/detail?id=271"&gt;JSR271&lt;/a&gt; for example). Even the weak UI can be improved using existing solutions like &lt;a href="http://www.eclipse.org/ercp/eSWTFullSpec-v20060803.zip"&gt;eSWT&lt;/a&gt;.&lt;br /&gt;So the question is open: do developers really need Android?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-6045278648014687326?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/6045278648014687326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=6045278648014687326' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6045278648014687326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6045278648014687326'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/11/google-android-is-it-way-to-go.html' title='Google Android - is it the way to go?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1139323419921309338</id><published>2007-11-08T08:38:00.000+01:00</published><updated>2008-01-01T17:33:33.611+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='midp3'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>MIDP3 - is it worth waiting for it?</title><content type='html'>In 2005 I was very interested about the &lt;a href="http://www.jcp.org/en/jsr/detail?id=271"&gt;MIDP3 proposal&lt;/a&gt;, but now, two years later it seems a little bit outworn. The expert group is not an active one, they published the early draft review only in September, this year. If this progress will not speed up, I hardly believe that the first MIDP3-capable phones will hit the market before 2009. And there are other promising technologies like &lt;a href="http://www.osgi.org/"&gt;OSGi&lt;/a&gt; and Google's &lt;a href="http://www.openhandsetalliance.com/index.html"&gt;Android&lt;/a&gt;. OSGi has already reached the mobile market, thanks to Nokia, and the Android SDK will be available in a few days. I don't think Android is based on OSGi, but it is developed by smart people, so I hope its architecture will be straightforward.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1139323419921309338?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1139323419921309338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1139323419921309338' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1139323419921309338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1139323419921309338'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/11/midp3-is-it-worth-waiting-for-it.html' title='MIDP3 - is it worth waiting for it?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-5000759913378575863</id><published>2007-10-27T20:12:00.000+02:00</published><updated>2007-12-15T17:46:25.944+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='component management'/><title type='text'>Component management in CLDC</title><content type='html'>There are several widely-known frameworks (like Spring or OSGi) that make component management easier. In a CLDC environment, however, they cannot be used, because (for security reasons) class loading is restricted to the system classes and the classes contained in the MIDlet Suite. This means that components outside the installed application cannot be loaded in a standard way, so  the JAR file must contain every component we want to use in the application.&lt;br /&gt;But how could we extend or modify our application after its deployment? A possible solution can be to assemble the MIDlet JAR automatically on server side from the requested set of components and to transfer the resulted JAR to the phone. Of course this requires the user to stop the running application and re-start it after the upgrade, but in most of the cases this is an acceptable compromise.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-5000759913378575863?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/5000759913378575863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=5000759913378575863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5000759913378575863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/5000759913378575863'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/10/component-management-in-cldc.html' title='Component management in CLDC'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-650575766286570718</id><published>2007-10-14T15:55:00.000+02:00</published><updated>2007-12-15T17:46:37.339+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>OSGi on low-end mobiles?</title><content type='html'>There is only one thing that prevents the wide adoption of OSGi (&lt;a href="http://www.jcp.org/en/jsr/detail?id=232"&gt;JSR232&lt;/a&gt; - Mobile Operational Management) in the J2ME world: according to the CLDC specification, it is not possible to dynamically load classes that are not part of the system and the MIDlet JAR. (Of course reflection would be useful, too, but we can live without it.)&lt;br /&gt;If we give up portability, however, there are several ways to work around this issue. The first and probably the most easiest is when you can access the class loader via OEM-specific APIs, but these APIs (even if they exist) are often public and well-documented. On Symbian phones there is another way (I've never tried, but I think it could work): you can write a native Symbian application which listens to a local socket and handles the serialized class sent by the MIDlet. Of course you need to have access to local sockets from your MIDlet, but most of the MIDP 2.0-capable phones implement this feature. This is somewhat similar to what ProSyst's management agent does in his product (mBedded Server CLCD Edition).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-650575766286570718?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/650575766286570718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=650575766286570718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/650575766286570718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/650575766286570718'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/10/osgi-on-low-end-mobiles.html' title='OSGi on low-end mobiles?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-4179240925799873545</id><published>2007-10-14T13:20:00.000+02:00</published><updated>2007-12-15T17:45:08.516+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>Java closures update</title><content type='html'>&lt;a href="http://www.parleys.com/display/PARLEYS/An%20update%20on%20Java%20Closures"&gt;Here is a presentation &lt;/a&gt;from Neal Gafter. It is recommended for anyone interested in closures for Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-4179240925799873545?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/4179240925799873545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=4179240925799873545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/4179240925799873545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/4179240925799873545'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/10/java-closures-update.html' title='Java closures update'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-1128290195123781290</id><published>2007-10-13T13:39:00.000+02:00</published><updated>2007-12-15T17:46:46.945+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='osgi'/><title type='text'>OSGi in mobiles?</title><content type='html'>I came home from Eclipse Summit 2007 yesterday. Unfortunately I didn't have time to attend the symposia, but anyway, the conference itself has been a great pleasure.&lt;br /&gt;I've been particularly interested in three topics: Equinox (and OSGi in general), MDSD and of course, anything else that relates to J2ME. I've seen great presentations (and not so great, but interesting ones), but my absolute favourite talks had been given by Uriel Liu of IBM &lt;a href="http://eclipsesummit.org/summiteurope2007/index.php?page=detail/&amp;amp;id=46"&gt;about eRCP&lt;/a&gt; and Gorkem Ercan of Nokia who talked &lt;a href="http://eclipsesummit.org/summiteurope2007/index.php?page=detail/&amp;amp;id=47"&gt;about eSWT&lt;/a&gt;.&lt;br /&gt;I have been telling for years that MIDP 1.x and 2.x are missing the most important thing: a well-defined component model. Yes, I know, that MIDP 3.0 is underway, but can the industry (and of course, the application developers) wait for years for the first MIDP 3.0-ready phones?&lt;br /&gt;I think &lt;a href="http://www.osgi.org/"&gt;OSGi &lt;/a&gt;can be a very nice solution for this problem, and finally it seems that at least Nokia thinks the same. I just hardly wait for eRCP for series60.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-1128290195123781290?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/1128290195123781290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=1128290195123781290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1128290195123781290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/1128290195123781290'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/10/osgi-in-mobiles.html' title='OSGi in mobiles?'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-4093871366339122730</id><published>2007-09-04T17:17:00.000+02:00</published><updated>2007-09-04T17:29:40.503+02:00</updated><title type='text'>Podcasts about software engineering</title><content type='html'>If you are looking for SE-related podcasts, you should really take a look at the &lt;a href="http://www.se-radio.net/"&gt;Software Engineering Radio&lt;/a&gt; website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-4093871366339122730?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/4093871366339122730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=4093871366339122730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/4093871366339122730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/4093871366339122730'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/09/podcasts-about-software-engineering.html' title='Podcasts about software engineering'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5112807191590872205.post-6169095373005155048</id><published>2007-09-04T15:50:00.000+02:00</published><updated>2007-12-15T17:44:41.265+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='language'/><title type='text'>Closures and Java</title><content type='html'>I've had some free time (first time for months), so I looked around the things I use daily. I found an interesting blog entry from Neal Gafter: &lt;a href="http://gafter.blogspot.com/2006/08/closures-for-java.html"&gt;Closures for Java&lt;/a&gt;. He wrote about the way closures will be (or might be) implemented in JDK7. I like the idea, but it is a double-edged sword. Nice, because the programmer can write very compact and expressive code (I always liked the expressivity of some declarative languages like OCL), but on the other hand it makes the code obfuscation very easy. Anyway, I hope this new feature will not affect the readability of codes written in Java negatively.&lt;br /&gt;I personally interested to see constructs like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;List foo = bar.select(some.boolean.expression.with.elements.of.bar);&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5112807191590872205-6169095373005155048?l=blog-o-lok.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog-o-lok.blogspot.com/feeds/6169095373005155048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5112807191590872205&amp;postID=6169095373005155048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6169095373005155048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5112807191590872205/posts/default/6169095373005155048'/><link rel='alternate' type='text/html' href='http://blog-o-lok.blogspot.com/2007/09/closures-and-java.html' title='Closures and Java'/><author><name>Attila Sragli</name><uri>http://www.blogger.com/profile/05723104852472765921</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://3.bp.blogspot.com/-x2HzCj5N5zI/TxVLPtHlTDI/AAAAAAAABU0/-8DO6xmeedw/s220/Ati_a_Kemeny_sziklan_terkeppel2.jpg'/></author><thr:total>0</thr:total></entry></feed>
