Partial Classes are a new feature of Visual Studio 2005. Basically they allow you to spread code across multiple code files. I have heard a lot of criticism about partial classes, mainly the whole "If you need partial classes then your class is too big".. Not so.
A good use for partial classes is with typed datasets. A lot of developers I have talked to use typed datasets for all of there Business Objects. The only problem is when you modify the database, then re-generate the typed datasets, any custom code is lost. By having the additional code defined in a separate file, this problem can now be avoided.
My only complaint with partial classes actually has to do with the functionality of visual studio 2005, more than partial classes themselves. My development team has a standard in place, where developers are required to use Overrides where possible instead of events. An example of this is using OnLoad override instead Form.Load event. Now, when you double click on a form in VS.NET 2k5, VS automatically creates a Form.Load event handler. In VB.NET, all you have to do is delete the actual event handler and all is fine. C# is a different matter. Not only do you now have to delete the actual Callback method, you now have to locate the "Hidden by Default" partial class containing all the designer code and remove the declaration for the Event Handler.
I actually dropped by the VS beta site http://lab.msdn.microsoft.com/vs2005/ and left a suggestion to allow the user to override the action performed when double clicking, but unfortunately I was told it was too late in the development process to look at that.. Hopefully we will see a change in Orcas??
Wednesday, November 24, 2004
Tuesday, November 23, 2004
Write Only Properties?
I was recently going through a colleagues code and noticed that in several places he had added write only properties. i.e. Set without a Get
In this case, he just happened to be a little on the lazy side, but it got me wondering, how often do people actually need to use write only properties. What are the reasons for having them?
The only possible thing I can think of would be security (all be it very limited), but surely there would be very few places where this sort of functionality is required.
I'm interested to hear other peoples feedback on this.
In this case, he just happened to be a little on the lazy side, but it got me wondering, how often do people actually need to use write only properties. What are the reasons for having them?
The only possible thing I can think of would be security (all be it very limited), but surely there would be very few places where this sort of functionality is required.
I'm interested to hear other peoples feedback on this.
A new Addition
Last wednesday saw the arrival of the latest addition to my little family, Alisha Jay de Bear.
Now the tally sits at 1 wife, 2 girls, 0 boys. I feel the odds are stacked against me :)
Now the tally sits at 1 wife, 2 girls, 0 boys. I feel the odds are stacked against me :)
Thursday, November 04, 2004
Back where we started?
Yesterday a bug was uncovered in an old application what was written in VB6. The bug had to do with forms not being unloaded because of some of the nice features in VB6. I'm talking about the Global Forms collection and the Default Form Instances.
Both of these features where useful, but lead to a large and dangerous group of people who produced a lot of bad, buggy software.
Until this recent event I was very impartial to the fact that the VB.NET dev team decided to re-introduce the Default Form instances into whidbey. Now I'm not so sure.
Are we going to end up with hoards of ex VB6 developers writing apps in VB.NET using the default form instance. I think yes.
I suspect the real reason behind this decision is to make the transition of VB6 developers to .NET a little easier. I think however, that we could well end up with many of the old habits that proved to be a problem in VB6 reappearing in VB.NET. This in turn could easily lead to VB.NET regaining the old stigma of VB6 in the general development community.
I for one am more than a little worried.
Both of these features where useful, but lead to a large and dangerous group of people who produced a lot of bad, buggy software.
Until this recent event I was very impartial to the fact that the VB.NET dev team decided to re-introduce the Default Form instances into whidbey. Now I'm not so sure.
Are we going to end up with hoards of ex VB6 developers writing apps in VB.NET using the default form instance. I think yes.
I suspect the real reason behind this decision is to make the transition of VB6 developers to .NET a little easier. I think however, that we could well end up with many of the old habits that proved to be a problem in VB6 reappearing in VB.NET. This in turn could easily lead to VB.NET regaining the old stigma of VB6 in the general development community.
I for one am more than a little worried.
Monday, October 04, 2004
Yay
I finally got my wireless network card working on my laptop..
Who would have thought that just changing the slot the network card was in would fix my troubles...
Maybe I need to get my laptop checked.. :(
Oh well, at least I can now blog from in front of the TV..
Who would have thought that just changing the slot the network card was in would fix my troubles...
Maybe I need to get my laptop checked.. :(
Oh well, at least I can now blog from in front of the TV..
Friday, October 01, 2004
COM Interop, the not so easy way
I have just read yet another article on msdn about how easy it is to create a .NET assembly that is callable via COM. It is really easy...
Now for my complaint... I have not seen a single article from msdn that actually goes into details of how to make sure that you .NET assembly maintains it's binary compatibility when you recompile...
Top that off with the wonderful CodeBase registry key that .NET puts in for you, and you will spend hours trying to debug deployment of you com component.
This article was just posed up on the MSDN site, it's yet another sample that shows how easy com is, yet it still misses all of the really important bits of information...
Visual Basic Developer Center: Database Developer Corner: Calling
Keep an eye on this space for more information on COM Interop..
Until next time...
Now for my complaint... I have not seen a single article from msdn that actually goes into details of how to make sure that you .NET assembly maintains it's binary compatibility when you recompile...
Top that off with the wonderful CodeBase registry key that .NET puts in for you, and you will spend hours trying to debug deployment of you com component.
This article was just posed up on the MSDN site, it's yet another sample that shows how easy com is, yet it still misses all of the really important bits of information...
Visual Basic Developer Center: Database Developer Corner: Calling
Keep an eye on this space for more information on COM Interop..
Until next time...
Tuesday, September 28, 2004
This is cool
I was just browsing around on the VS.NET 2005 Beta site, when I cam across something really interesting. The Online MSDN library for the beta has been setup to make finding help really easy. Give this a try:
http://msdn2.microsoft.com/library/System.Windows.Forms.aspx
It works for any namespace/class in the beta...
I really hope they keep this after release..
http://msdn2.microsoft.com/library/System.Windows.Forms.aspx
It works for any namespace/class in the beta...
I really hope they keep this after release..
Wednesday, September 15, 2004
XP SP2 all done.
I finally finnished installing XP Service Pack 2 on all of the machines that I look after for all my family and friends. I have not encountered a single problem with any of the machines.
I also took the chance to change the configuration of all the machines. Each user now runs a restricted account. So far I have not had a single complaint.. I have tought all my friends and family to use the "Run As" option (right mouse click on application icon) for installing applications (and running applications that need admin access, which is very few).
In general, I thinks it's been a very good experience and think that MS have really done their homework on this one...
I also took the chance to change the configuration of all the machines. Each user now runs a restricted account. So far I have not had a single complaint.. I have tought all my friends and family to use the "Run As" option (right mouse click on application icon) for installing applications (and running applications that need admin access, which is very few).
In general, I thinks it's been a very good experience and think that MS have really done their homework on this one...
Tuesday, September 14, 2004
Look at me
I finally got around to setting up my own blog.. Wow...
Just a little bit of information about me..
My Name is Eddie de Bear, I'm a Software Developer living and working in Canberra, Austrlia.
I Specialise in .NET related technologies.
Speeking of .NET releated technologies, that is what alot of this blog is going to be about... .NET, C#, Sql Server and other really geeky things..
Anyway, I better get back to work.. Watch this space..
Just a little bit of information about me..
My Name is Eddie de Bear, I'm a Software Developer living and working in Canberra, Austrlia.
I Specialise in .NET related technologies.
Speeking of .NET releated technologies, that is what alot of this blog is going to be about... .NET, C#, Sql Server and other really geeky things..
Anyway, I better get back to work.. Watch this space..
Subscribe to:
Posts (Atom)