CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

March 2004 - Posts

  • DotNED and Delphi.NET

    The Dutch .NET user group dotned will meet again coming april 22. This time we are hosted by Deco ICT Solutions in Apeldoorn. Amongst others Hassan Fadili, dotned most loyal member, will do a presentation. Subjects for the talks are :

    • Model-View-Controller (MVC) Design Pattern
    • Borland Enterprise Core Objects (ECO)
    • .NET Remoting

    There is a lot of Delphi.NET in DotNED. Borland has released a trial of Delph.NET. A 30 day fully functional download. That's on my todo list, I still havn't given up.

    Peter

  • It is a new build ! Welcome .NET 2.0

    I installed the MSDN Visual Studio 2005 CTP and found out it looks like quite a different build as the one handed out at the PDC. When you compare version numbers for VS you get 7.1 for VS.NET 2003, 8.0.30703 for the PDC build and 8.0.40301 for VS.NET 2005. It gets even closer to the real thing when you look at the version number of the .NET framework. Which is 1.1 for VS.NET 2003, 1.2 for the PDC  build and 2.0 for VS.NET 2005. That's getting close to the real thing !

    There are nice new project types. Like Word and Excel projects. Seen that at the PDC, it is a whole different ball-game compared to the current office projects. A distributed application was a project which resulted in a “not supported“ message, now it is called a distributed service solution and looks a lot like Whitehorse.

    The only thing which puzzles me is the name. The name VS 2005 is all over the place but at several spots they still call it Whidbey. Never mind : check it  out !

    Peter

  • Internet domain names

    I live in Groningen, in the north east of the Netherlands. West of us is the province of Friesland, their local language has an official status. The Frisians are proud  people who take the Frisian language very serious. Last weekend Dutch newspapers had a small story on the Frisians and the internet.

    The Frisian name for Friesland is Fryslân. So the oficial internet domain would be www.Fryslân.nl but as that doesn't fit the domain naming standards it has become www.Fryslan.nl. The news was that the Frisians were deeply insulted for their name being “mutilated”. To the east of us they speak German, the German language is also very rich in “strange” characters. Imagine www.spaß.de ? And what about France or Greece ? www.ellas.gr ? I could go on to Russian, Arabic, Persian, Hindi, Tamil, etc. But I'll stop here, to get this done took me quite some fiddling with the html of this post and I'm sure these domain names will allready look quite strange in quite a browser.

    I hope to have made my point. Local culture enriches life but if you want to look outside you have to make a comprise.

    Peter

     

  • Adding a control a runtime : what is not in the viewstate

    In several earlier post on adding controls at runtime and the potential impact on the viewstate I could have created some confusion. You can add controls at runtime but these controls will not become part of the viewstate of their parent control (the page itself is also a control). If you want to persist the new control over  roundtrips you have to add the control again and again on every roundtrip. The viewstate is used to store all those properties which pop up in the property window.

    Instead of adding a control again and again I personally prefer to add the control at design time and set its visible property to false. When the control is needed it will become available by setting the property programmtically. An even nicer way is to bind the visible property to a custom expression, like the name of a (protected) method on the page.

    Peter

  • Why Page_load ?

    When VS.NET generates a webform you get one eventhandler for free :

    private void Page_Load(object sender, System.EventArgs e)
    {
       // Put user code to initialize the page here
    }

    Almost all asp.net demo code uses this generated eventhandler to do its thing. But this event does not allways have to be the right moment for your code. A recent post on adding controls at runtime included a quick walkthough of the page life cycle and the many other places your code can hook into.

    Considering page load :

    1. Page_load is too late. When adding controls the viewstate is reported to mess up. On_init would have been better.
    2. Page_load is the right moment. After the page is loaded the full context, with session, request(url) and response, is available. A good moment to load some data.
    3. Page_load is too early. Most eventhandlers, like button clicks, are processed after the load. It would be better to wait until the prerender event. At that moment you know all your eventhandlers have done their thing and you can process the results.

    Hooking your code into the wrong event can make your code have to go through some strange hoops to work right.

    Wouldn't it have been better if vs.net genereated by default :

    private void Page_Load(object sender, System.EventArgs e)
    {
       // Put user code here
    }

    private void Page_Init(object sender, System.EventArgs e)
    {
       // Put user code here
    }

    private void Page_PreRender(object sender, System.EventArgs e)
    {
       // Put user code here
    }

    ?

    With thanks to Bill.

    Peter

  • Every hardware we dream of, we are getting

    Last night I watched the combined Vs.live / mobile devcon / speechTEK keynote online. It's Bill Gates speaking on Visual Studio 2005. Not a dazzling show but it did include several good demos. For those of you who visited the PDC only the speech server was a new thing.

    The most interesting aspect to me was the hardware targetted. The quote used as a title for this post actually was on today's graphics cards and processors. But in general VS and the .net framework target far more than just a PC or server. Mobile phones, organizers, cameras, everything you can dream of and any hybrid ofspring. All make up perfect targets for your .net apps. It's not about Windows, it's about ms coming to a device near you. The compact framework is going to be very important in .net 2.

    Worth mentioning is the quality of the video. Far better than the usual MSDN tv. Full screen, good picture quality, no hickups and no distorted sound. WMP 9.

    Peter

  • Microsoft ? Which Microsoft ?

    Yesterdays post on the EU fining Microsoft did draw quite some reactions. To me (and most readers) it is the technological side which troubles me. I was wondering, it was the EU versus Microsoft. Which is a legal case. But what are you thinking of when ms is mentioned ? Let's take three familiar faces :

    • Steve Ballmer. He is very good at shouting “developers, developpers“, but he is seldom seen in the world of developers. His main image is that of the shark ms-bashers love to hate.
    • Bill Gates. He's about “leveraging the experience“. His talks and conversations are about a school-boys dream came/coming true. To the non-developers world he's just ver very rich.
    • Don Box. In his days before “working for the firm” (to quote his own words) he was deep in ms's propriatary COM. Since joining he's deep into xml and soap, the non propriatary ways to communicate with the world outside ms. The non-developers world doesn't know him.

    To me, as a developer, Don and the many, many other inspiring people working at ms are the face of ms. I do like what they are doing and I can make a living using their products. Steve and Bill are part of a (good) sideshow, they provide the playing ground. The EU-trial is a bad side-show, they want to take the toys from the boys.

    Peter

  • 497 milion euro's of stupidity

    Politics on a European Union level never have been very popular in the Netherlands, one of the EU-members. Europe is important but the EU's verdict on MS does not help convincing me. It's so stupid, any geek can explain in a couple of lines that it is the content which counts, not the software rendering the contents. The history of the case does demonstrate that very well. Nobody ever cared about Windows Media Player until new WMP formats, with a competitive quality, appeared. Besides that the Realplayer is a stinking spammer. I would gladly uninstall it, but on some sites real still has a monoploy. Quicktime is OK, it's there and just works when it has to work.
    I hope the EU will do something usefull with the cash, but I fear the worst.

    Peter

  • Debugging web.config

    The web.config file is a hell of a place to store your settings. The downside is that you have to be very carefull about what you type. The whole file is parsed before the app is started. When an error is found, the app will not start. Trying to debug this from VS, by pressing <F5> will present you with a very serious message:

    Sounds bad. But when you start the app without debugging, by pressing <ctrl F5>, asp.net will tell you what's wrong in every detail:

    Peter

  • Exceptions in mscorlib when debugging

    This is a little trick Gaston of MyFone  learned me. It was his project which started it but let me share it with all of you.

    When trying to debug an asp.net app VS kept on popping up errors in mscorlib.dll. Most errors pointed to things going wrong with parameters passed to COM objects used. But .net should take care of that and worse was that the errors were hard to reproduce. The fix was in the Debug | Exceptions menus of VS (<ctrl><alt><e>). These settings are on a project base ! Here you tell vs what to do when an exception is thrown in this app. Settings are applied on categories of exceptions. Exceptions in the CLR forms one.

    In this project VS was told to break into the debugger for a CLR exception. Setting it to continue fixed the problem. The second option is what to do with unhandled exceptions. I would like to see these in the debugger. But nothing came back, the CLR was perfectly capable of handling them.

    Peter

  • A virus going after the developer him(her)self

    Last week's SDGN meeting was great fun. I did two presentations and followed two others. Lot's of C#, objectspaces, xml, DTS. What a day. A special treat was the lunch. Apparantly some of the food was infected. The virus had a latency of over 24 hours and its first symptoms were disguised as a kind of flu the kids take home from school or kindergarten. But it was bad, really bad. The productivity of a great number of Dutch (and Belgian) developers dropped for several days. It's now a week ago and ocasionally I still feel the poison upsetting my stomach. What shall we do, sue the caterer ? What would you do ?

    Peter

  • Java and .NET forced to divorce

    The SDGN is a Dutch user group with quite a long history. We started somewhere around 1986 as a Clipper usergroup.  With the coming of Windows the scope broadened with Delphi, Visual Objects (the Windows successor to Clipper which never reached the fame of Clipper but has the most faithfull developers you can imagine) and MS Office. In came Microsoft and quite short after its introduction .net was added to the list. Java joined as well. We are an independent user group.

    Being independent does not mean that any help from the tool vendors hurts. They provide you with first-hand information and have the contacts to get you a speaker. Both MS and Java had their thougths about the other but when it came to cooperation their attitudes were different. MS always was a great help. In the early .net days they provided everyone a free copy of Eric Gunnerson's Programmers introduction to C# (Apress), which made me an early defector from Delphi/VCL to C#/FCL. Just over a year ago the SDGN and MS together organized a big Don Box presentation. Which was great as well.

    On the opposite Sun refused assitance. They favoured their own NLjug user group and would tolerate our Java group as long it didn't get big. Their main argument against us was that they didn't want to be on one (SDGN) flyer with MS. Our Java group was no big success and things threathened to escalate. The result is that we kicked out Java. Feeling sorry for the good people leaving.

    All future communications will be in XML, perhaps some in Borland's Janeva. We'll continue with .net (in C# and vb flavor), Delphi in Win32 and .net flavor), VO and people doing all kinds of things from php and Dreamweaver to C++. A (still) quite inspiring diversity.

    Peter

  • Sex, lies and Whitehorse ;>

    Yesterday Stephen Forte did his Whitehorse presentation in the Netherlands. Good show. I had seen parts of the project on the PDC's architecture forum. Stephen also showed how code and the model updated each other. The reason for me parafrasing a movie (I don't even know) was the way Stephen did the demo. Instead of having some kind of  alpha on his laptop he played a movie in Media Player. The movie had been taped at MS, the product was reported to be still to unstable to survive a demo. The bad thing about the movie was the quality. The screen shown was small, combined with the available real estate on the laptop most texts were barely readable. Pitty, it is a fascinating product. Planned for Whidbey.

    Peter

  • Useful datasets

    Recently Ken Brubaker gave a nice overview of recent discussions on creating distributed apps with .NET. Some of the main points :

    • Most .net demos are monolithic. The data-access and UI are all in one assembly.
    • Most demo apps work with datareaders and not with datasets.
    • Datareaders cannot be serialized, making it very hard to split the stone
    • Most .net demos deal with nice datagrids and lists

    I plead guilty on the last point as I've writen quite a lot on data-grids and -list. But I also love typed datasets. Originally because their OOP representation really appeals to my background of strongly typed OOP code. My demos were often monolithic. In a new article (it's now up on the dnj, thats no news as you all read the dnj newsletter..) I'll show you how to break my stones. It covers

    • Splitting database access and UI into separate assemblies
    • Flexible and secure db settings
    • Viewstate roundup
    • Using usercontrols.

    Hope you'll like it.

    Peter

  • Importing datasets in a VS solution

    Yesterday I posted about a problem Patrick Peters (faithfull SDGN member) had with a dataset. The problem was that VS did not generate the dataset class for a given schema. I could reproduce his problem but could not produce a solution. Stared myself blind on the schema, posted it, got some helpfull hints. This morning I took a fresh look and I think I have found it.

    The schema is OK, it is what VS.NET is (not) doing with it. Items in the solution have a custom tool, for a dataset this should be MSDataSetGenerator. For the imported dataset the tool had gone missing. Filling in MSDataSetGenerator resulted in the desired dataset classes turning up. The tool setting is stored in the project and can be set from the property window

    The question why the tool got lost remains to be solved...

    Peter

     

More Posts Next page »