Monday, November 29, 2004

Designing generic systems/functions

 Originally posted on: http://geekswithblogs.net/meshel/archive/2004/11/29/16413.aspx

This is a constant issue here at the company, and I guess that it arises almost everywhere.

Let me first explain that we are a company that deals with software development, and mainly for our single product (which is in fact several, but it doesn't really matter).

Each time we develop a new feature, or update a previous one we are of course forced to deal with issues of backward compatibility, and others not only within our products but also with various third-party providers that integrate into our system. This is a known problem for everyone including even (and especially) large companies like Microsoft. Each deals with it in it's own fashion, from introducing a completely new set of APIs (.NET) or just adding new ones where there is no option within the existing API framework.

But I'm not here to discuss that, the problem I want to write about is quite different.

One of the concepts every programmer has heard about (even if some do not implement it) is code re-use. Writing good functions/objects/routines/components (or any other name you want to call them) so that in the future you can take that component by itself and use it to save time, money, and duplicate code. This is a challenge in its own way, and achieving such a level where you can create a project from neatly stacked components is very hard to reach. But the benefits to this approach are quite easy to see - especially in software companies. And this is why of course, managers in software companies push their programmers to achieve this.

This in itself of course is no problem, however, in most cases, there are additional requirements that filter down with each new version/feature that require different output/ more data/ less data etc... Question is, with all the good intention, how to design a component that will forever do whatever is required from it?

For example, we have a standard error format for our web services, and it is based on the internal error format which has been used for years. It is no problem for me to push in almost any data into that internal error object, however, the Output format for the web service is a simple (yet efficient) Code/Description model, where the user gets an error code, and with it a detailed description (that when relevant contains the specific problem in the field).

All of our web services, are managed through generic code, which parses the incoming data, validates it according to the business rules etc. The errors are converted from the internal error object, by another generic function that knows to convert the internal error object to the readable form.

Suddenly today, comes someone from the management and demands this special API (with which I can't argue, since it IS needed). However, because of special issues (it is a special API) some of its features including the input format and the error output are quite different than those of all the others. All generics are broken! this function need eventually to have some code duplications (since we don't want to hurt the behavior of the other APIs) and specific modifications for it.... This is driving me nuts.

Does anyone have a solution, or is this why we still have work (as programmers)?

Just venting here, I'm not REALLY angry....

Thursday, November 25, 2004

Books for professionals

 Originally posted on: http://geekswithblogs.net/meshel/archive/2004/11/25/16004.aspx

http://www.books24x7.com/   -Referenceware for Professionals

http://www.safaribooksonline.com/  - Safari Bookshelf

http://safari.oreilly.com/  - O'Reilly Safari Bookshelf (same as Above I think it is the original)</a>

Some online book libraries - should ask my boss to get us a subscription, seems like a stupid resource not to use considering the prices - that of reading text online (which I should get used to by now) in this library, compared with the price of actually buying a book, waiting for it to arrive and finding out that it isn't good enough (especially with the crazy prices charged for these books, especially in Israel)

.NET Deep dive (Microsoft Israel Dev Convention) Impressions

 Originally posted on: http://geekswithblogs.net/meshel/archive/2004/11/25/16014.aspx


I'm guessing that by now all the major speakers in this convention have written something about it (they sure did before :-))

Event details (in hebrew) are here (with downloads)

It was awesome interesting demos (some which actually worked :-), actually everything worked except for a crash or two - what more can you expect ). A lot of laughs. Excellent lectures.

I personally learned a lot, being as I am, with not that much real world .NET experience, I found out that I actually know quite a lot, and that everything explained made sense for me, with actual implementation I could think about for a lot of it.

Yosi Tagury talked about new things to be in the coming VS.NET 2005 Team system, with amazing demos. After being for years in the VB world “edit and continue” seems not so special, but the new IDE with all the additions (Automated code tests, Refactoring support, code snippets, custom object viewers - WOW etc)... I have to tell you I am impressed by the guys at MS - the level of thought that miust go in to such a product, puts anything I ever did to shame. If you want to know what I liked the most - and it is a trivial thing, really, is the fact that when you open a solution - you don't have to save it anywhere, if you don't want to... This to me shows that they really take the programmer into thought when they design. not only adding new interesting features, but also (at long last) understanding how programmers use the product in a day to day scenario. I mean how many times a day do you open a project just to test something out? something you would never keep in your ever growing code library... I know I do it a lot.

Roy Osherove talked about TDD, very interesting. Although I agree with the idea, and can see how it would create better code, and also more maintainable (and many other advantages that I can see). I find it hard to adjust to the frame of mind needed to actually implement this method of working. I can see how it works for simple functions and classes, maybe even moderately complex ones, but I have written quite a few functions in my short professional life, that would be really hard to build using this methodology. I realise that I need to learn more about how to do things under this methodology, and I hope that I get a chance to participate in one of the workshops he is running.

For most of the day I was with the #2 Track of the event, and there I heard the following

Gadi Meir (I don't thing he has a blog) from http://www.idag.co.il talked about EnterpriseService class in the framework, this was the first time I heard about it, and I am ashamed. This is such a great thing for an enterprise programmer to have. Pooling, Transactioning, Security Policy all those got demos, and seeing the capabilities of this - I can't get why anyone is still writing this plumbing code himself. Thank you Microsoft!

Yair Shivek talked about WSE 2.0 - he discussed some of the the new enhancements focusing mainly on WS-Policy and WS-Security. This to me was interesting since I have been involved with Web Services for a long time, and was wondering when someone will make use of that header element... However, I was disappointed to hear that with all the time passed since the inception, serious Interop problems exist. This for means not to implement any of this yet, and although he gave quite a good argument (to which I agree) of why these extensions are better for SOAP then SSL (although they seem to have the same function) -  I will stick with SSL for now. why? because:
1. SOAP still works mostly over HTTP - the services I write are for a web site - then why not
2. SOAP for me is still a two way thing - whoever calls me needs the response in almost all cases
3. SOAP for me is still point to point and not end to end - meaning only server client relationship with no intermediaries - in this situation I think SSL is actually better, certainly a more mature solution, even in my opinion less mistake prone.

Memi Levi talked about enhancing development experience (not to mention time saving and blunder preventing) by using organization/team defined templates, and adding Design Time Attributes to custom controls. This was enlightening and made me start thinking of to use this when I start working in .NET . I was a little sad that Add-Ins weren't in the scope, in the VB6 IDE I use today, I have a couple of internal add-ins that help me so much, I couldn't live without them.

All in all a day full of knowledge and learning! a very good day. I'm sorry I can't be at two places at once which is why I missed the rest of the presentations that went on.

A funny thing that happened, I talked to Yosi at one of the breaks about the issue I mentioned in the last post, what I didn't write there is that I managed to finally convince the management at my company that we need to seriously plan the move to .NET - and that I wrote a requirement document, and they just informed yesterday that they got from MS Israel some experts to help on the issue and guide us along the best path. Once I explained the issue to Yosi, he took a look at the tag I wore which had the company name - and told me that he IS the expert that is coming over to us, he also said that he will try to bring Leon along. This made me even happier!

Tuesday, November 16, 2004

Moving to .NET (am I???)

 Originally posted on: http://geekswithblogs.net/meshel/archive/2004/11/16/15093.aspx


Hi, haven't written here for the longest time...

I'm still looking for a new job, since there are no really interesting offers flowing in (and I still have my old job), I'm still not making that move. Also there is a chance of salary rising at my current place of work - so I don't want to leave before that.

For the issue at hand, we are contemplating starting a move to .NET in our product. for those who haven't had the pleasure of knowing me yet, lets just say, I've been a programmet here for the last five years, and mostly wrote in VB, ASP using SQL Server for database. That's what the product I've been working on uses among others.

I've been pushing for the move to .NET for the last three years, after I got to do a project or two using it, and fell in love (some web services, and interop with Java). I mean it was hard to get into it (especially because of the interop issues) but once that was over - everything just went so smooth and easy. You just can't compare it with the old stuff. Not to mention the new IIS and http.sys.

Anyway to make a long story short, the company is now considering this finally. It usually takes them about three years to reach a decision when I'm offering the change - maybe I move to fast? I'm not sure. It took some people here threaten to quit the job, if a major change is not done (I don't know if you know, but looking at wanted ads in my type of profession, you see requirements for Java, .NET, C++ and non for VB - so the motivation is clear on my side).

However, no here can afford the budget of simply migrating the application to .NET at once (tens of thousands of lines of code). and the only option available is a slow process through releases where until completion the two platforms (VB and .NET) will be working side by side.

Now I've been looking around the internet, and searching for the main issues so we can prepare for them. there appear to be two main issues:

  1. Maintaining session state (ASPSession) between the two applications
  2. Using VB DLLs from the .NET assemblies and vice versa.

Can anyone point out some other issues they know of, or maybe recommend ways to deal with these issues? finding an easy solution for these will certainly speed our way in this.

Let me just mention some technical stuff: 

  • Our session holds objects as well as string data
  • We have many VB DLLs with dependencies (I don't know how this is relevant)
  • I need to understand how to deal with situations where DLL Compatibility is broken (mainly from the VB side.
  • Good DAL solutions (to convert the Data Layer from VB to .NET)
  • Any tips on using connection pooling (articles, solutions, anything)
  • We want to develop in C# mostly.