Archive

Archive for the ‘Technology’ Category

Maintaining momentum

December 19th, 2008

First I’ll get some personal-goings-on out of the way.

As my previous post implied, I’m now quite happily working as a software designer at Sininen Meteoriitti, which just so happens to be the other one of the two companies recieving honorary mentions in the earlier industry-related rant.

Things are pretty good here. I’m surrounded by brilliant people and a refreshingly easy-going corporate culture. Programmers follow conventions meticulously and thus the codebase is clean and easy to get into. Not all of them are exactly radiating with passion, but it clearly is there nevertheless.

The company has reached a respectable size of 60 employees, but there still is a distinct air of work-in-progress about. That is by no means a bad thing. When there isn’t an answer to everything, you kinda get a chance to slip your own thoughts in.

I’m not saying that you really need any corporate tactics nor politics to get your voice heard here. The hierarchy is there but communication-wise it’s flat as a pancake.

So.

I was talking with the CTO the other day on MSN, trying to conjure up an idea for a blog post. The subject that kinda jumped at me was the challenge of keeping employees involved in the constant stream of new technologies.

Two prime motives for tackling this challenge

First, to keep enthusiastic and information-hungry people engaged to the company. People belonging to the aforementioned category (including yours truly) like to stay on the cutting edge and experiment with new things. Doing project work on the same platform for years on end – to me – seems like a valid motive for job-hopping.

Second, to keep your company on the cutting edge. This isn’t to say that you should embrace each and every new framework, O/R mapper or project methodology thrown at you – updating and refactoring your existing codebase to support new technologies all the time is an easy way to waste money and keep the bug tracker busy – but you definitely should stay on top of things. This is a vast subject on its own, and better covered elsewhere, so I won’t go deeper into it for now.

So what can you do to keep your staff educated?

There’s the traditional approach of sending people off to courses and seminars. A good approach as such, but I’ve often found it somewhat slapdash in execution. Sending an employee off to a crashcourse on WPF is merely driveby-education if you don’t provide means to apply that freshly acquired knowledge on anything. Slightly problematic, taking into consideration the fact that the first client case shouldn’t hastily be seen as a concoction to acid test Ruby On MonoRailCat 0.02 Community LOL Preview in.

However, I’ve yet to see or hear about a software company that has its own toolset fully covered and refined. The shoemaker’s daughter has no shoes and all that. Internal development is a great field to test one’s skills at and really learn the practical ins and outs of new technologies. A typical example of this is the dreaded timesheet application. Every software company needs one and everyone needs it to be just slightly different than the other one.

Sending an employee off to a course and then giving her the chance to apply the freshly learned skills onto something relevant – but not too critical – is a really great way to keep an employee’s skillset up to date and bring a breath of fresh air to the job.

An idea of a slightly more comprehensive and academic approach came from our brilliant CTO, Jouni Heikniemi. He proposed that I could perform a speech to the company on the subject of a technology I’ve had my eye on for some time now, namely Microsoft Oslo. The idea being that I first have to learn a thing or two about the said technology.

Needless to say that learning a technology to the point that one can confidently speak to an audience about it should develop a pretty good understanding on the subject. However, the trick here is actually to make a project out of learning and allocate some time and resources to it.

Lastly, there’s the Google way: 20-percent time. It’s about giving the employees a chance to work one day a week on stuff not necessarily in their job descriptions. Funding employee-driven open source projects seems like a good idea to keep employees experimenting and innovating. It doesn’t have to be 20%, nor does it have to be any other statically defined amount of time. Encouragement and allocating time on need is enough.

The 20-percent time principle somewhat overlaps with the first technique, and indeed the way forward could be to let the employee think of her own projects, but if none emerge, she could be given an internal development project to fiddle with the way she likes.

To boil it down, there isn’t a silver bullet here, but I think you’ll agree that people should be given the time and possibilities to educate themselves and apply the knowledge on at least something. But even more than simple methods and principles, the constant education process requires the right atmosphere.

Encourage. Inspire. Host your own techdays. Build an extensive library.

P.S. My blog scored a fancy caricature of my hairy mug. Thanks go to Janne Itäpiiri for that.

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology

What’s the deal with RDLC reports and object datasources anyway?

June 30th, 2008

It’s time to let out some steam again. I thought it was one of the stupidest shortcomings in Visual Studio 2005 that there wasn’t a convenient way to bind local reports to business objects defined in external assemblies. In fact, I can’t even recall finding a usable workaround for it. I would’ve expected Microsoft to address this in Visual Studio 2008, but no: It’s either typed dataset or domain model in the website’s App_Code. WTF is the deal with that? Who keeps their domain model in the website?

Am I missing something here?

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology

C# and multiple inheritance

June 11th, 2008

God damn I’m a crap blogger.

There. I’ve said it. And now onto the rant of the day. Why doesn’t C# support multiple inheritance? Well the official answer, as stated by Chris Brumme:

1. Different languages actually have different expectations for how MI works. For example, how conflicts are resolved and whether duplicate bases are merged or redundant. Before we can implement MI in the CLR, we have to do a survey of all the languages, figure out the common concepts, and decide how to express them in a language-neutral manner. We would also have to decide whether MI belongs in the CLS and what this would mean for languages that don’t want this concept (presumably VB.NET, for example). Of course, that’s the business we are in as a common language runtime, but we haven’t got around to doing it for MI yet.

2. The number of places where MI is truly appropriate is actually quite small. In many cases, multiple interface inheritance can get the job done instead. In other cases, you may be able to use encapsulation and delegation. If we were to add a slightly different construct, like mixins, would that actually be more powerful?

3. Multiple implementation inheritance injects a lot of complexity into the implementation. This complexity impacts casting, layout, dispatch, field access, serialization, identity comparisons, verifiability, reflection, generics, and probably lots of other places.

Yea. Well. All of these are probably valid and good reasons why there is no multiple inheritance in C#. However, I just stumbled upon a frustrating scenario today where the lack of MI is a pain.

The architecture I’m developing at the moment is using NHibernate for data access and I’d like to implement a data model, in which the database has e.g. the tables Person, UserAccount, Employee and Company. In the domain model I’d like to have classes for each of those tables, so that you could deal with companies and users as such, but also have classes like CompanyUser, that inherits from UserAccount and Company both. The former is of course in this particular case, where UserAccount and Company have a one-to-one relationship (well technically speaking it’s a many-to-one, but logically a one-to-one), which is a typical scenario in some of the software we have under construction. In the case of an employee, the employee table just extends the data of a person record so single inheritance works just fine there.

Having said that, I already see some problem materializing with multiple inheritance. All of my domain model classes inherit from a base class that includes some time stamp fields common to all entities. Imagining a case, where you first create a company and at a later point in time create a corresponding user account, you’d end up with differing timestamps for the company and user account. Now, having the CompanyUser class inherit from both results in a conflict.

Which base class’s timestamps should be inherited? A solution I could think of, would be to – in case of MI – inherit both but give them a syntactically different exposure. E.g. if I had a CompanyUser object cu, I could refer to the base Company’s UpdatedOn property like cu.base[Person].UpdatedOn or something similiar.

I hear what you’re saying. Why don’t I just extract interfaces from from Company, UserAccount etc?

Firstly, interfaces are already running amok in a loosely coupled architecture such as mine, and I really don’t feel the idea of calling everything thru interfaces. It just makes navigating in the code that much harder. So referring to something within the same assembly and even the same namespace, with no actual possibility to ever change the implementation of a entity class such as the UserAccount, thru an interface just makes no sense to me. The implementation is there and it’s always the same so no reason to mess with middle hands here.

Secondly, in addition to the obfuscating effect of interfaces in this scenario, it adds stupid amounts of work. Consider this:

  1. Create the tables Company and UserAccount
  2. Generate the entity classes and mapping files for both with MyGeneration
  3. Extract interfaces of both the classes
  4. Create a new class CompanyUser that implements the interfaces
  5. Copy+paste pretty much the whole classes to the “inheriting class” to achieve proper implementation (private members, internal accessors for NHibernate and the public accessors)
  6. Create a mapping file for the “inheriting class”
  7. The data schema changes -> repeat from 2

Thirdly, wouldn’t it be nice to ask NHibernate for a UserAccount and receive a CompanyUser or PersonUser or whatever, that you could later on cast to either of those types if needed?

At the moment I have a class CompanyUser, that inherits the class UserAccount and implements the interface ICompany. It has a Company field that is exposed via the ICompany properties. I guess this works for now, but In case of a schema change it’s proven a bit cumbersome.

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology , ,

Flat Solution Explorer

January 24th, 2008

My god I fell in love with this thing. Best thing since sliced bread.

http://www.codeplex.com/VSFlatSolutionExp

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology ,

Window angst

December 4th, 2007

OK here’s the scenario. Pretty much all the records in the database have a logical key, such as the CustomerCode in Customer, UserName in UserAccount, TicketReference in Ticket and so on. So if I want to define the customer for a ticket, I have a search control on the ticket form that should be working as follows: you input the customer code into a textbox and click the search button and since the code is (or rather should be) unique, the only match is referred on the ticket.

If, on the other hand, you input e.g. the first 3 letters or so and get multiple matches for the query, a grid should be displayed on a modal popup dialog. Not a popup window as such, since popup windows are annoying and stupid, but a control like the RadWindow.

Now don’t get me wrong, I really like the RadControls, but occasionally they tend to run my nut in with their extensive client-side focus. Also, working with RadControls and the AjaxControlToolkit controls, I have found them a bit artificially restricted in functionality. I have found several requests in the Telerik forums for the ability show content within a RadWindow merely declaring the window like a panel:

<telerik:RadWindow ID="RadWindow1" runat="Server">some content here</telerik:RadWindow>

The answer to these requests remains “the RadWindow isn’t intended to be used like that, but hey here’s the handy javascript function SetContent, that allows you to set the content to whatever you want.” Yea sure, if it would actually work (which for some unfathomable reason it didn’t for me) and all this javascript business gives you hell if you want to append some server-side controls into the window.

There is of course the possibility show a page in the window with all the functionality I need, but I couldn’t sleep at night knowing that I had just wasted several roundtrips through the layers and built stupid load on the session variables and so on that it would require. Additionally, it would be ugly code and annoying to implement.

Putting RadWindow aside after a tiresome jiu jitsu duel (that took way too much of my precious time), I decided to give the AjaxControlToolkit ModalPopupExtender a go. Once again, some clever developer somewhere had decided that the popup extender is just meant to show simple dialogs such as “Are you sure you want to delete the internet?” or so. Resulting in the frustrating behaviour of the popup to hide itself whenever a postback occurs inside it. Really handy considering my scenario, where the popup shows a grid and some controls to refine the search.

The ModalPopupExtender also refused to show itself from the codebehind when it was enclosed within a RadAjaxPanel, which I really prefer over UpdatePanel because of the handy LoadingPanel functionality.

If only it had the features, RadWindow would be the preferred choice of the two, primarily for its skinning features and resizability. Sure, the control I’m after isn’t that complex and shouldn’t be that hard to code myself, but I just want to avoid developing my own controls until the very last, to take at least some of the support pressure off of my back.

Oh how I miss developing Windows Forms applications. I don’t miss deploying them, though.

bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Technology , , ,