the corner office

a blog, by Colin Pretorius

# Eclipse dependencies

Between the moving and packing/unpacking, I've managed to squeeze in a very wee bit of Eclipse tinkering. As I mentioned before, I saw two things to get my head around: SWT/JFace development, and the Way of the Plugin. I figured I'd be as dumb as possible about plugins to start off with, and focus on putting together GUIs.

That wasn't so easy. I could have sidestepped the plugin/RCP thing completely and just fired up some windows from a main() method. I didn't want to do that, but I was wrong in thinking that you don't need to give thought to plugin management from the get-go.

The first problem I ran into was trying to use my tco.util projects as dependencies like I normally do for standalone and web apps. No go. You can refer to another project at compile time, but not at run time. I read a forum post explaining that I'd need to turn my depended-upon projects into plugin projects of their own, and then specify the dependencies in my plugin.xml.

Not happy with that idea... much like my gripes about Eclipse WTP wanting to stomp over utility projects, I don't want to have to plugin-ify utility projects which aren't going to be used only in a plugin environment. The alternative is to roll the util projects into separate jar files. You then have two choices: you can either include the jar file directly into your plugin, in the usual lib/ directory style, or else you can create a separate plugin which uses the jar file.

If you include the jar file in a lib directory, then presumably it loads within the plugin's own classloader. You need to explicitly add the jar file to the classpath entry on the plugin.xml's 'Runtime' tab. Unfortunately, you can only specify locations within the current project directory.

Alternatively, if you want to use the jar as a separate plugin, then Eclipse has a tool which allows you to create a plugin project from a jar file.

Either way is a pain, because rolling these jar files is a chore. It is possible to hook in custom Ant scripts which do it automatically when code changes, but that's not my idea of pretty, and it's frustrating when I just want to crank out something easy to play around with.

I understand why plugins needs to so rigidly separate: that's the whole point of the design, but for development and testing it would be nice to have a third way: specify a POJO-esque project as a dependency on a project's build path, as normal, and allow the IDE to either virtually or physically include the depended-upon project's class files and exported jar files in the current project's class path.

File under: java : {2007.04.25 - 22:58} : Comments (0)

# Moving and bad marketing

What a week. Started out with a cold and a cough from hell, not good timing! We're finally in the new flat, thankfully, and now I can let my creaking bones and joints rest for a bit.

A casualty of the move is our ADSL line. BT were brilliant in switching the phone line over, in the morning the phone was working in the old flat, and in the evening, we plugged the phone in at the new flat, and it just worked.

As for ADSL, not so lucky. We'd chosen Namesco in December, and I knew they had a £60 cancellation fee if you cancel your line in the first year. What I didn't realise, is that if you move to a new home, you have to effectively cancel your line, pay the cancellation fee, and sign up again. And you'll pay the cancellation fee yet again if you move home or change ISPs within a year.

This is just not clever customer relations - neither charging a full cancellation fee nor positioning a move as a cancel and re-join transaction. The customer support person was quick to point out that this is all in their terms and conditions. I don't doubt that it is, and it's my fault for not reading the fine print about moving premises, but I still feel a bit shafted.

I wouldn't have had a problem paying some sort of transfer fee, and I'd have gladly stuck with Namesco for the next year, and probably indefinitely. Now, instead of keeping an otherwise loyal customer, they've instead succeeded in ensuring that they have an annoyed customer who feels short-changed, and since I have to pay the full cancellation fee anyway, I may as well move to another ISP, just on principle.

Until that's sorted out, we'll be back on dial-up. Yaaaay.

Update: in fairness, BT don't deserve much credit either, because it seems a large part of the cost (around £40) goes to them, and their cease/re-open mechanism is just plain stupid as well. That doesn't change the fact that Namesco could do things a little differently. I also changed the post a bit because I referred to the support person in a way that was a bit snotty and uncalled for, and I don't need the bad karma.

File under: personal : {2007.04.22 - 16:20} : Comments (2)

# Packing and moving

We got our flat on a short lease, not sure if we'd want to - or be able to - stay in this neck of the woods. We're moving this coming week, and things are getting a little rushed. Thankfully our move entails lugging stuff down one stair case and up another... yep, we couldn't keep this flat for longer, but we like where we are, so we're moving to another flat in the same block. Even a simple move like this entails a lot of missioning, and we'll be rather glad to get settled in the new flat, and just chill the hell out until Junior arrives.

The impending move upped the pace of the book cataloguing. I have a few more boxes to do, but I'm nearly done. The catalogue spreadsheet is currently sitting at 989 books, in 47 boxes. Much to Ronwen and everyone else's amusement (or pity or exasperation, I'm not sure which), I decided to weigh each box on the bathroom scales before I sealed it. I don't know why people think I'm nuts - if you're going to put boxes in storage, piled 4 or 5 high, it makes sense to have the 20kg boxes at the bottom and the 5kg ones at the top. The easiest way to decide which boxes go where is to know how much each box weighs. Plus it really gets the accountant in me all juiced up.

Anyway. I can report that these 47 boxes weigh over 450 kgs. The books still to be packed and those that won't be packed will come close to another 50kgs. So when people say 'gee, you must have a ton of books', I can honestly say 'no, only half a ton.'

File under: personal : {2007.04.16 - 00:23} : Comments (0)

# What doesn't pay rent must go

What's up with chavs and spitting? You have to keep your eyes down when walking around town; the pavements are peppered with oysters. I was walking to work this morning and a dude with his chunky jewellery and tracksuit hocked up this beast right in the doorway to a shop. I wasn't the only person who saw him do it, and he just didn't care. As always, part of me wanted to chirp the dude, but the chickenshit part of me reckoned it was best not to.

Oh well. I remember in my cycling days that it was a rite of passage to master the high-velocity, high-pressure nose blow. Sometimes you couldn't afford to rummage around in your jersey pocket to find a handkerchief, so onto the country road it went. Finger blocking one nostril, and let rip down the other. If you did it right, it was poetry in motion. If you did it wrong, people behind you in the pack would get mighty antsy.

At least chavs don't go around blasting snot onto the streets. Small mercies.

File under: personal : {2007.04.13 - 01:07} : Comments (0)

# Eclipse: a n00b assay

What's the big deal about Eclipse? Plugins and GUI.

Plugins first. What's the big deal about plugins? I don't fully have my head around it, but it's about modularity. When I first started doing Java development, I was a complete stranger to the concept of introspection. The idea that you could write code that not only did stuff, but loaded and changed and knew how to understand the code itself. Cool. The idea that you could write a bit of XML and a program could make sense of that XML and load up and execute separate chunks of code, code that wasn't compiled into the application up-front, code that might only be written months or years later. Cooool. That's how J2EE applications work, and it's not arcane knowledge, but it's still pretty damned powerful.

Each Eclipse plugin is just a piece of code that gets pointed to by a bit of XML, and there are lots of rules which say how a plugin should play with other plugins. The interface between a plugin and its parent code is called an extension point. The parent knows how to talk to an interface, and if the plugin implements the interface, then the parent can load the plugin code, and call methods on that interface. The head-bending bit is that not only can you build an app horizontally by having lots of plugins working side by side, but you can modularise vertically, too. A plugin, or module, or bundle in OSGI terminology, can define its own extension points, and other plugins can then hook into those extension points, and they can in turn publish extension points, which other plugins talk to, and so on...

So basically, Eclipse takes the concept of modularity and redlines it. It's about writing small bits of code, wrapping them up as plugins, and then stringing them all together using (mostly) XML configuration files. The Eclipse platform is, at its core, a simple kernel-like runtime which reads these config files and is smart enough to load up the bits of code, as and when (and if) they're needed.

The second unique thing about Eclipse is its GUI. Java's standard GUI toolkits, the primitive AWT and the newer Swing, are meant to be truly cross-platform toolkits. The intended upside was that the Java GUIs would always look the same, regardless of platform, and the unexpected downside was that Java GUIs tended to look a little, well... crap. The toolkit might be nice in its own right, but never quite fits in, because it doesn't feel truly "native". Eclipse's answer to AWT is SWT. Unlike AWT, which tries to be truly cross-platform, SWT tries to look exactly like the OS it's running on. It provides a standard API, much like AWT, but the API is just a thin layer over the underlying platform's GUI toolkit. JFace is a higher-level extension to SWT, much like Swing is a higher-level extension to AWT.

Starting to learn how to do Eclipse development means getting comfortable with two new things. First, resisting the temptation to hard-wire your entire application together; getting to grips with the Way of the Plugin instead, and secondly, mastering a new GUI toolkit.

File under: java : {2007.04.12 - 00:50} : Comments (0)

# Knuckle down, Bert

Right. Eclipse. I'm not sure if the Eve market app is really such a good candidate (but I'm letting the idea stew), but there a few other desktop apps I could tinker on. Eclipse RCP, here I come!

I've been dipping my toes in the water the past few weeks, but again, not getting far. The reason is that I'll sit down, starting reading the introductory help docs, and after a page or two I'm starting to wonder about what obscure bands I could find on Youtube. The Eclipse help documents are comprehensive, but they make for dry reading. Playing with real code is a far better way to learn, and so that's what I've started doing now. As with any new API or platform, it's frustrating when you don't know what you're doing and you're battling to see the wood for the trees and obscure classes. I'll get there, but it's all still a bit confusing.

I'd said that I would talk about my progress, and even though I don't have much to report right now, it will be an interesting milestone to jot down some notes about where I am now, and what I know and don't know. That'll come tomorrow.

File under: techie : {2007.04.11 - 01:30} : Comments (0)

# Until next year, Easter Bunny!

A nice Easter weekend. We spent a lot of it visiting and eating. That was fun. We drove around the local countryside a bit, and that was fun. My poor beleaguered missus got roped into helping me catalogue our books before the freshly re-packed boxes get sealed. I heave, number and rifle through boxes and reminisce, she types. Ronwen might not agree, but it's a great trip down memory lane going through your books and remembering who and where they're from, when you read them, and so on. We're only a fifth of the way through the boxes, so I may change my mind towards the end, but for now, it's been fun.

I also spent a lot of it playing computer games. That was also fun. As I mentioned, I've had a renewed interest in Eve Online. I dusted off my old Eve market analysis app this weekend, thinking that I'd spend some time extending it. It's just too much like spaghetti, and designing it as a fancy web app is just a pain. Is this perhaps a candidate to play around with an Eclipse RCP app? Even if it isn't, I think it would be an interesting exercise to whip up a little someting and get a measure of how different it is.

File under: personal, techie : {2007.04.10 - 00:00} : Comments (0)

# Sleep is for the weak

I've been packing books for the most, this week, and the few spare moments haven't been spent doing anything productive, either. I revisited Eve Online after a long hiatus, and a colleague at work introduced me to the Lord of the Rings Online beta. Now I have a long weekend to try catch up the sleep I've lost the past week.

File under: personal : {2007.04.05 - 23:45} : Comments (0)

# Plasticbagspotting

Apparently it's a bit pawsh to go shopping at Waitrose doll, so I'd best point out that I wasn't name-dropping in my book post from the weekend. Apart from the fact that our dorpie only has a Waitrose and it's on the way to the bus stop, there's another reason why I can't go shopping for resealable plastic bags at the ornery-folks supermarkets. I'd bought a box or two of plastic bags 2 weeks ago at the nearest Sainsburys in Oxford, but as luck would have it, this past week has seen Sainsburys move from good old fashioned outlive-the-cockroaches polythene plastic bags to the degradable type, which is no good for storage. I've now visited three Sainsburys between here and Oxford, and they're all starting to stock degradable plastics. Just my luck. So Waitrose it is.

At the risk of slipping into real resealable plastic bag arcana, it's frustrating as hell that in supermarkets, you basically have two options. Crappy bags made by a crowd called Baco and the supermarket's home brand. Dear American globalist corporate imperialist overlords, please bring your wonderful Ziploc goodness to our supermarkets. Pretty please.

Something I noticed is that Sainsburys and Waitrose obviously have the same producer in China: the labels and blurbs on the bags are exactly the same. The only difference is that Waitrose bags cost about 30% more size-for-size and their large bags are a bit bigger than their Sainsburys counterparts. Which probably means that it's only a matter of time before Waitrose moves to degradable bags as well.

Bloody environmentalists. The whole of the North American and Asian continents will be sinking into the rising oceans under piles of rubbish and black ooze and sludge, but the UK will still have hap-hap-happy landfills. Lucky for us!

File under: personal : {2007.04.02 - 23:47} : Comments (0)

# British prisoners

The saga of the 15 British soldiers captured by Iran is amusing to watch when I'm in a good mood, and plain annoying when I'm not. You know it's all a diplomatic dance. Were they in Iranian waters or not? It doesn't really matter. What are the chances of the UK really cranking up the hostilities if something bad happens, and what are the chances that the Iranians are really going to harm them?

It basically boils down to their capture being a stroke of luck for Iran. The British act all tough and huff and puff, the Iranians act all aggrieved and make threatening noises to get the British news all a-twitter. It's all a media game. In the background, you know the only real issue to be resolved between the UK and Iran is just how much the UK has to pay to get the soldiers back.

Or maybe I'm wrong. In which case the Iranians are freakin' stupid.

File under: politiek : {2007.04.02 - 23:03} : Comments (0)

Next »

meta

-home-
about
contact
disclaimer
articles
code
tech blog

style: [?]
[plain.dark.blue]

Categories

java
linux
music
notes/domino
personal
politiek
studies
techie
thee_blog
world

RSS Feeds

rssfeed all posts
rssfeed all cmts
rssfeed tech posts
rssfeed tech cmts

Archives

2010.09
2010.08
2010.07
2010.06
2010.05
2010.04
2010.03
2010.02
2010.01
2009.12
2009.11
2009.10
2009.09
2009.08
2009.07
2009.06
2009.05
2009.04
2009.03
2009.02
2009.01
2008.12
2008.11
2008.10
2008.09
2008.08
2008.07
2008.06
2008.05
2008.04
2008.03
2008.02
2008.01
2007.12
2007.11
2007.10
2007.09
2007.08
2007.07
2007.06
2007.05
2007.04
2007.03
2007.02
2007.01
2006.12
2006.11
2006.10
2006.09
2006.08
2006.07
2006.06
2006.05
2006.04
2006.03
2006.02
2006.01
2005.12
2005.11
2005.10
2005.09
2005.08
2005.07
2005.06
2005.05
2005.04
2005.03
2005.02
2005.01
2004.12
2004.11
2004.10
2004.09
2004.08
2004.07
2004.06
2004.05
2004.04
2004.03
2004.02
2004.01
2003.12
2003.11
2003.10
2003.09
2003.08
2003.07
2003.06

© Colin Pretorius