Tag Archives: OO

Ten years!

It’s been 10 years since I joined Kexi and thus the KDE community. I think writing down some history and summary makes sense.

2003-03-28: first touch on Kexi sources for porting

It all started at a technology fair in Warsaw, 2003. I wasn’t too keen to go but got free tickets and free time. I met a founder of OpenOffice Polska LLC (later renamed to OpenOffice Software) from Warsaw presenting its adaptation of deeply localized, nicely prebuilt office suite based on OpenOffice.org. The office suite has been open sourced StartOffice over two years before by SUN and then localizations or user handbooks basically did not exist. During the meeting among other topics we also discussed apparent missing bit in the OpenOffice.org suite: a rival of MS Access. I proposed to perform some research on how the app can be added. I got hired and engaged full-time from March 2003.

Join the big guys

The business model was largely similar to what is known from server Linux tools or support subscriptions: offer the tools for free, with the source code, and build products and services (such as support) on top. I was already confident that my adventures with open source would start soon, I just wasn’t sure what project to join.

My initial attempt should have been obvious: say hello to OpenOffice.org to start a MS Access clone project within it. That was nice theory but has never worked since OpenOffice.org project wasn’t even semi-openly governed. Talking to OO.org meant talking to SUN Microsystems. A small company is rarely a part in such relations.

So another solution was to start from scratch or join existing open source project that shares our goals.

By that time a great smart guy Lucijan Busch from Austria already started his work on Kexi which he launched as a summer project in 2002. (a hint for all of you who think you’re too young to start doing some KDE Junior Job, you are wrong, Lucijan was only 16 years old when he started Kexi!)

Lucijan in 2004 or so

MS Windows, positive side effects

Based on the business model of OpenOffice Polska, Kexi had to run natively on Windows to integrate well with to OS. So a side effect of my project was the KDE on Windows initiative that resulted in another general-purpose target for KDE software which is now a subproject on its own. Initial selection of features (such as larger parts of KDElibs) was closely related to needs of Kexi Windows port. I owe a big credit to my employer that it allowed me to contribute in a sane way instead of just accepting code forks.

Naturally, for some time I was the only hacker using MSVC for actual KDE code. Having the Linux KDE Desktop around all the time but about first three …read more

Source: FULL ARTICLE at Planet KDE

Rick Spencer: How I Learned to Love QML and Inheritance Therein

Gotta love the “developer art” … those placeholder images should be replaced by sweet Zombie artwork as the game nears completion.

For a long time I resisted the QML wave. I had good reasons for doing so at the time. Essentially, compared to Python, there was not much desktop functionality that you could access without writing C++ code to wrap existing libraries and expose them to QML. I liked the idea of writing apps in javascript, but I really did not relish going back to writing C++ code. It seemed like a significant regression. C++ brings a weird set of bugs around memory management and rogue pointers. While manageable  this type of coding is just not fun and easy.

However, things change, and so did QML. Now, I am convinced and am diving into QML.

  • The base QML libraries have pretty much everything I need to write the kinds of apps that I want to write.
  • The QtCreator IDE is “just right”. It has an editor with syntax highlighting and an integrated debugger (90% of what people are looking for when they ask for an IDE) and it has an integrated build/run system.
  • There are some nice re-factoring features thrown in, that make it easier to be pragmatic about good design as you are coding. I also like the automatic formatting features.
  • The QML Documentation is not quite complete, but it is systematic. I am looking forward to more samples, though, that’s for sure.

In my first few experiences with QML, I was a tiny bit thrown by the “declarative” nature of QML. However, after a while, I found that my normal Object Oriented thought processes transferred quite well. The rest of this post is about how I think about coding up classes and objects in QML.

In Python, C++, and most other languages that support OO, classes inherit from other classes. JavaScript is a bit different, objects inherit from objects. While QML is really more like javascript in this way, it’s easy for me to think about creating classes instead.

I will use some code from a game that I am writing as an easy example. I have written games in Python using pygame, and it turned out that a lot of the structure of those programs worked well in QML. For example, having a base class to manage essential sprite behavior, then a sub class for the “guy” that the player controls, and various subclasses for enemies and powerups.

For me, what I call a QML “baseclass” (which is just a component, like everything else in QML) has the following parts:

  1. A section of Imports – This is a typical list of libraries that you want to use in yor code. 
  2. A definition of it’s “isa”/superclass/containing component – Every class is really a component, and a compnent is defined by declaring it, and nesting all of it’s data and behaviors in curly brackets.
  3. Paramaterizable properties – QML …read more
    Source: FULL ARTICLE at Planet Ubuntu