Complexity and Dealing with it in Software Development

If you’re programming, you most likely know that problem. You try to solve a problem, and deal with some sort of library, framework or concept you haven’t used before. Inevitably, you fail to get it working right of the spot and get frustrated. This is where people in my field are every day, as we’re using new technologies, frameworks and concepts all the time.

701 - Puzzle - Seamless Pattern
There of course isn’t a precise way to solve such problems. But the only sure way to approach this is to make sure you grasp the underlying concepts. If you’re building a web application with some client side jQuery goodies loading stuff from your struts2-server, the first step isn’t to learn about Struts2 or jQuery. Make first sure you understand:

  • how a HTTP-Request works
  • what GET and POST means
  • that HTTP is stateless and what that means to your application
  • what JavaScript is and where & how it is interpreted
  • what AJAX is besides a nice word you heard often
  • how a server works
  • what request and response are
  • what a servlet is

Connect all the information

After you have understood the basics, you can go on and understand the higher level stuff. This is what most of us learns while attending a university, but you never have understood everything and you’ll never stop hitting new fancy acronyms and technologies if you’re into programming. But for every acronym you see and that you don’t understand, try to make sure you at least read the Wikipedia page before you try to do some fancy coding by copypasting things you found via Google – because if you don’t understand what you’re using just now, you implemented a black box that might or might not work and that you didn’t learn anything about.

When you approach new concepts, frameworks and technology in that way, you can build up a solid foundation of knowledge that get even more solid every time you learn another new technology that bases on stuff you already know, assuring to yourself that what you learned before is correct. Fast and dirty is slower in the long run. And as such, you shouldn’t be concerned that something takes some time to understand – because when you don’t really understand it, then you won’t be able to fix the issues that will occur anyways. And it’s a long way from zeroes and ones to AJAX.

Creative Commons License photo credit: Patrick Hoesly

Getting started with ServiceMix 4.2 and WebServices (with Maven and Eclipse on Windows)

(Under this post I noted down some great resources for getting started, so if you’re searching for those, have a look at the bottom of this article)

Okay, I had a really hard time getting started with ServiceMix, as there’re so many technologies involved and I knew none of them. Maven. OSGi. ServiceMix. Karaf. Most of the time, you only want something to work so you can apply the same or nearly the same technique again, right? So here’s a little plan what works and where you can start your journey:

- Install maven. Install Eclipse.

- Install the m2 plugin for eclipse.

- Download ServiceMix 4.2.

- Open a windows command terminal. Navigate to %servicemix_home%/bin

- “servicemix.bat” starts ServiceMix. You get into the Karaf console. Typing TAB and “y” shows you a lot of commands you can try out. (If you want, try some … easy administration!)

- Open Eclipse. Seriously. Import –> Maven project

- In the wizard, browse to %servicemix_home%/examples

- Pick the “cfx-osgi” folder and use the pom.xml the wizard finds there for importing the project. Finish the wizard.

- Change the sourcecode of the HelloWorldImpl.java file to do what you want and save that file.

- Right click the project –> Run –> Maven install. A .jar file gets generated.

- Copy that jar file into the %servicemix_home%/deploy folder.

- Get back to Eclipse … there’s a client.html file in the imported project. Right click that –> Open With –> Web Browser

- Click the “send” button. Smile.

- (Optional: Now remove the .jar file from the deploy folder of servicemix. Click the “send” button on the HTML form again. Smile.)

If you want to learn more, you can look into the FUSE ServiceMix documentation (FUSE is documenting and selling support for ServiceMix, but they don’t put much more on top of ServiceMix, so the documentation is pretty good). Or try the text files that come with the examples.

Hope this helped you a bit.

Edits and Updates:

  • I found this tutorial VERY helpful dealing with and understanding BCs: http://servicemix.apache.org/hello-world-bc.html
  • And as you will be using Spring anyways and there’s no way around it, just to understand how simple it works, begin with this small tutorial: Getting started with Spring
  • FUSE is a trademark that’s selling support for servicemix and label servicemix as “FUSE”. No matter if I got that right, FUSE is basically just ServiceMix. As the FUSE people are apt writing nice documentation (and the ServiceMix-page documentation basically sucks), you should head over to FUSE and read their docs (click on documentation and see a lot of nice PDFs). They explain everything you need in a well-written way – OSGi, Spring, Karaf, Maven, CXF, …
  • If you want to use Eclispe and Maven to build OSGi bundles, read this page calmly. It explains how you configure all the OSGi stuff in the pom.xml. Additionally, don’t try to use Eclipse’s plugin-development features as this will mess with your dependency resolution. Maven seems to say: put everything into my hands and you’ll be fine (even if you don’t like me).
  • This is a neat wiki article for getting started with building OSGi bundles for ServiceMix from Eclipse.
  • Here’s a nice article and tutorial explaining how to develop OSGi Bundles with Eclipse.

RDFa Editor Presentation

I just finished my final presentation as the finishing-line for my studies in computer science. I wrote about the inclusion of a RDFa-Editor in a blogsystem, where a user can include semantic annotations in their posts. The goal was to create a tool for editors that would enable them to enrich the posts they make with individual semantic markup. Its mainly focused on usability and is based on the WYMeditor and two servlets. It should be easily portable and perhaps this can be an inspiration for CMS-vendors, so normal people without domain-knowledge (in RDF and Ontologies) will be able to post semantic markup for their contents.

The presentation is made with the flash-tool of prezzi.com and is completely in GERMAN. You can find it shared here. Let it first load the media before you go on watching. If you experience lags, you can download the more smoothly runningoffline-exe-file.

If someone needs a translation, I might invest the hour of work doing so (just post a comment). This is the presentation … click on the forward button to move forwards, in the downloaded version you’ll find the forwards/backwards-butons in the lower right corner and can also use standard powerpoint-presentors:

I hope you like the idea – and I hope that the semantic web world gets more usable for “usual people”, otherwise it might not come to reality for many more years. If you’re interested in the thesis, let me know.

What after studying computer science?

Its long till you heard from me as I was finishing on my Diploma till now. I finally did it. Well, spelling correction and some reader response still needs to be incorporated, but after all its just finished.

It about an online-rich-text-editor with support for RDFa (as lately support was announced by Google for RDFa, it should be pretty interesting for some out there). This means that I took WYMeditor, put it into a blogging platform, connected it with Freebase, added some RDF-Parsing and there you go with annotating your HTML sourcecode with semantic RDFa-markup.

You can add resources from Freebase without knowing anything about RDF, RDFa or Ontologies, you can use some static concepts like the Google review-stuff and some FOAF-concepts and you can even generate RDF-triples, that means semantic statments that machines can interpret. I mainly focussed on usability as I imaginged that most of the worlds documents don’t get created by too technical-adept people but others who’s knowlegde focusses on another area – and who use rich-text-editors to place content online.

I also had a pretty good idea for a sematic twitter service that could revolutionize the semantic web – but as I really need some experience in the free enterprise world, I can’t really start a startup now … or can I? Well, there are more buisiness ideas in my head, so maybe someone else should do the sematic twitter stuff. Well, I’ll maybe just put it online after its approved, we’ll see.

But what now? Another three year of science? No, after all, I need a job now. As I’d like to stay in Oldenburg (Germany, near Bremen), I need something in about half an hour range from here. I like web-technology, am into Java because its the “educational standard language”, but would really like to get to know some more. I worked with Struts2, JavaScript, jQuery, XML, JSON, AJAX, PHP, RDF, OWL, HTML, CSS, SVN, … I’m interested in iPhone-Applications, Social Media, Scrum Project-Management, Usability Engineering, Semantic Web (+more stuff) and would love to find a job to learn more and do something producive with my skills.

Some big companies still don’t want new people as the financial crisis makes bureocrats feel more important now, and some just don’t think they should get to know you if you didn’t send a copy of your diploma with the letter of application – and they don’t really read the letter, as I clearly say that I need to wait about two more month till I get it.

Well, its not that I don’t know what to do and learn in my free time. But where shall I begin? Learning .NET and Visual Studio? Delving into Flash or Silverlight? Try to make an iPhone App (got some useful ideas for that)? Work on business ideas? Finish reading the latest Design Patterns- or Scrum-book? Try out Hibernate? Blog some more? Many questions, no answers. Perhaps I’ll just write my next dozen of application-letters. After all I’ll need some money to buy a nice server machine ;-)

Learning to Code – You Really Want to be a Programmer?

There is a lot that you can do wrong. A lot that I did wrong and that took its time. But after all I think I made it. So here are some simple rules that you should follow if you’re trying to become someone who touches keyboards a lot:

Have a goal. If you just want to be a programmer but don’t know anything that you’d like to program, you’ll have problems keeping yourself motivated. Going into a certain direction of technology is a good idea too, so you know what you can concentrate on.

Just do it. (In fact, this statement is the best you can do in any situation of life.) Every time that you’ll write code, you’ll learn something new that will get you closer to your target.

Never miss an opportunity to code. If you have a project where you’re working / studying, try to take responsibility for some functional piece of software. Documentation or user-testing won’t get you further.

Use an IDE. I began with writing java code in a text editor, compiled it by hand and did so for some time, because I thought “Eclipse looks … complex”. It was an error that cost me soo much time. Embrace all help that you can get, if its an IDE, a build tool or whatever tools you’re friends and colleagues use. They all save time, and thats the stuff life is made of.

Don’t forget to use a console too. There are a lot of graphical things out there that want to make you move the mouse more and the keyboard, but often there are no better solutions than just using the command line. Don’t be afraid of it, you’ll have to learn all the commands sooner or later anyways.

Make a list of skills & experiences that you’d like to have. Making your first objects, Unit-testing, working with threads, building a gui, parsing some HTML or XML, getting data into a database or out of it, using the twitter API, building a website, writing a firefox-plugin; HTTP, HTML, CSS, JavaScript, Flash, (a lot more Web-Technologies), Frameworks of all kinds … write down what you think would be useful whenever you meet something new you want to learn … and then make it some kind of long-term-To-Do-List.

Don’t think too much about inheritance, interfaces, reflection, … you can first live without that or just use it by-the-book and will understand what they do soon.

There’s no magic involved. Just code. Like in JUnit, I somehow thought it would verify that my code has no errors if I just configure it correctly – plain wrong, no magic inside! You have to write code that checks everything in your other code. I also thought Struts2 would make websites by magic – again, just code. There’s nothing visible that you don’t code, its just makes just need very few code to get those websites running.

Framework is a signal word. Its means “Software that makes something easier for you”, but you should be aware that you’ll need to invest some time to learn how to use it. Framework should give you a positive feeling, when you hear it, like “I’m here to help you!”. Again, no magic involved. Usually ;-)

Ask. Use online forums, ask friends or people you work with. Google can’t always help (but don’t ask question that Google can answer easily). There is so much that could be known about technology, that noone knows everything (especially when you don’t have your master in computer sciences and 10 years of field-experience). Just accept that and also accept if others don’t have all your knowledge.

Teach. If someone asks you and you know a solution, then help him. Assume he didn’t understand something basic that you know and be sure that you teach it so he can solve the same task again later on. Never just give someone the code, they won’t gain anything from that.

Find someone to learn with. Someone who is the same stupid guy like you and also doesn’t know how to do that complicated stuff. Where one brain gets stuck, two often find a solution and both learn. Working together on a project is a great way to learn. Just make sure the other person keeps up with you, or vice versa.

Never stop learning. Technology evolves with lightspeed, new languages appear, new technology is invented. If you’re involved with computers, you’ll probably be one of the most-learning-and-training persons of the world. Never assume you’re ready to “just do work”. Where would be the fun then?

Get tech feeds. Or follow twitter-users who have the smae interests that you have. From time to time, there will be interesting articles that will teach you good new stuff.

Don’t be afraid to buy books or magazines. Its not always cheap , but if it saves you time learning you should just spend that little money. You’ll get that money back with your skills later.

Get your head around this object-orientation-thingy. Don’t use GOTO. Don’t put the whole code in the main-method. Classes are just there to produce objects and objects are nothing more than some fields and methods in one instance. If you write a main-method, produce an object that does that work from there. Objects can be tested nicely and are more useful.

Its not just coding. Software design, team management, data structures, design patterns, team-collaboration, algorithms, time management are all with you at that party. And much more. And don’t you ever forget your social skills. They might be the most important after all. Even programmers need friends ;-)

Be careful with your coffeine comsumption. A programmer is a person who converts coffee to code, after all. If you still want to code, connect with me on Twitter. What do you think I missed? Do you have more hints for the newbies? What was not ever told YOU, that you should have known from the start? Just add a comment …