Re: Replace a framework class
- From: "e-mre" <EmreT@xxxxxxxxxxxxxxxx>
- Date: Fri, 18 May 2007 16:41:26 +0300
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@xxxxxxxxxxxxxxxxExtending 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@xxxxxxxxxxxxxxxxxxxxxxxxxHi 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.
.
- Follow-Ups:
- Re: Replace a framework class
- From: ThunderMusic
- Re: Replace a framework class
- References:
- Replace a framework class
- From: e-mre
- Re: Replace a framework class
- From: Brian Schwartz
- Re: Replace a framework class
- From: Steven Cheng[MSFT]
- Re: Replace a framework class
- From: e-mre
- Re: Replace a framework class
- From: Michael D. Ober
- Replace a framework class
- Prev by Date: Re: Replace a framework class
- Next by Date: Re: Replace a framework class
- Previous by thread: Re: Replace a framework class
- Next by thread: Re: Replace a framework class
- Index(es):
Relevant Pages
|