Re: Replace a framework class



I agree, changing a class in the Framework in a way that will effect all
other applications that use the framework is a bad idea. But replacing the
class with an effect range of a single application, which is my application,
would be quite useful.

As I mentioned before, Java guys say that, in Java you can do that by
placing the new implementation of the class in your code. The class is
replaced only in your application. Other applications are not affected.

Now I am convinced that there is not a feature nor a workaround to achieve
this behaviour, but I still believe it would be cool to have it.

Emre



"Michael D. Ober" <obermd.@.alum.mit.edu.nospam> wrote in message news:%23FZnxtUmHHA.2552@xxxxxxxxxxxxxxxxxxxxxxx
The problem with what you want to do is that consumers of the underlying class, in your example - DataSet, expect it to behave in a particular way. If you override one of DataSet's members or properties and change the behavior, you risk breaking someone else's code and the end user nor the other developer will ever figure out why.

This issue has come up over and over in the history of the PC. For example, there is a bug in the original IBM PC BIOS Int 10 video interface. That bug is now a feature and still exists in all Int 10 BIOS handlers. A more recent example is that the Vista development team found a bug in XP's disk caching. During testing, they found that there are commercial applications that take advantage of this bug for performance reasons. As a result, Vista has a user configurable switch that emulates this bug, at the risk of data integrity. (See the April 2007 TechNet article for the Vista/XP issue as well as a similar issue between Windows 3.11 and Win95.)

Mike Ober.

"e-mre" <EmreT@xxxxxxxxxxxxxxxx> wrote in message news:5DC353C7-8CF0-4936-8BE1-7DBCC62C77C3@xxxxxxxxxxxxxxxx
Extending an already existing class is a solution but it will not solve
every case.

Let's say that I have a extended a class, say DataSet, and named it
MyDataSet.

The new class MyDataSet will have all the functionality of the DataSet class
but will take place in a completely different namespace. I can use MyDataSet
class in my code. But existing code in the .NET framework or in other third
party code that refer to the DataSet class will still refer to the same
class. MyDataSet class will be left out of the loop.

Perhaps DataSet class is a bad example for the case but I hope you get the
picture. Any suggested solution for this?

Emre


"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message news:heyoeD2lHHA.4356@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi E-mre,

As for .NET framework's fundamental class library, it doesn't support
manually customization or replacement. This is because framework class
library is deployed with the .net framework CLR runtime, and all these
class library assemblies are compiled with a specified strong-name
identity. Therefore, you can not build a custom assembly to replace any one
of the fundamental class library. So far, if you want some customization on
some functionality, you may try creating a derived class from built-in
one(if supported) and use your own derived classes in application code.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.










.



Relevant Pages

  • Re: SP3 potential problem
    ... Microsoft.net Framework 3.5 SP 1. ... Start, Help and Support, Keep your Windows up- to-date with Windows ... Event Source: Application Error ... Have a look in the System and Application logs in Event Viewer ...
    (microsoft.public.windowsxp.basics)
  • Re: SP3 potential problem
    ... I believe the Dell support person directed me to a Dell site to download the ... Where did you download the ATI drivers from? ... Windows Update, Review your Update History you can see the update. ... Framework items from my machine. ...
    (microsoft.public.windowsxp.basics)
  • Re: Problem with VS 2008 Setup project
    ... change its checking version to .net framework 2.0) ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ... Problem with VS 2008 Setup project ...
    (microsoft.public.vsnet.general)
  • Re: IDE products roadmap updated
    ... latest greatest framework, blah blah... ... IMO, DevCo is going to have an uphill battle in the .NET space. ... support is *unacceptable* and I think they know it. ... I really like Ruby/Rails, IMO the problem with supporting it in BDS is ...
    (borland.public.delphi.non-technical)
  • =?Windows-1252?Q?Re:_=28Microsoft_.NET_Framework_3.5_=96_Beta_1=29_to_=28?= =?Windows-1252?Q
    ... True, just a small warning though, installing Orcas (V3.5 of the Framework)installs SP1 for the V2 of the framework, that means that your V2 Framework has an updated version of the CLR and compilers and some tools. ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.csharp)