Suppose that I have a class in an assembly that is delivered to the user,
what can I do to change the class so that it doesn't break the
binary compatibility? That is, user application can run with recompiling
and relinking.
I know that if I define an interface, and only expose the interface but not
the class which implments the interface, I can add a data member to the
class without breaking the binary compatibility. If the class itself,
rather than the interface is exposed to user, can I still add a data member
to the class without breaking the binary compatibility? What are other
restrictions that won't break the binary compatibility?
In pure C++, adding a data member to a class that is exposed to the user
will break compatibility.
Thanks. 6 3285 Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with recompiling and relinking.
A mistake: 'with' should be 'without'.
hi
when you are speaking about com and binary
compatibility.A dding an interface only generates a new iid
and does not break the binary compatibility as new version
can use the new features(class with new iid included)
where as the older version still works with their older
version.The compatibility breaks only when you changes the
signatures or remove some interfaces etc.
But with .Net you need not to depend on registry .The only
thing you remember is how are you handling the versioning
and whether you are using private or shared
assemblies.Ther efore you need not have to be worried about
binary compatibility at all because in .net multiple
version can run side by side and even you can specify
which client or application will use which version of the
components.
hope that this helps
shreeman sn*********@red iffmail.com -----Original Message----- Suppose that I have a class in an assembly that is
delivered to the user,what can I do to change the class so that it doesn't
break thebinary compatibility? That is, user application can run
with recompilingand relinking.
I know that if I define an interface, and only expose the
interface but notthe class which implments the interface, I can add a data
member to theclass without breaking the binary compatibility. If the
class itself,rather than the interface is exposed to user, can I still
add a data memberto the class without breaking the binary compatibility?
What are otherrestrictions that won't break the binary compatibility?
In pure C++, adding a data member to a class that is
exposed to the userwill break compatibility.
Thanks.
.
"someone" <so****@somewhe re.com> wrote in
news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with recompiling and relinking.
..net applications are just-in-time compiled; There is no "linker". The kind
of tasks that used to be done by the linker are done at runtime (by the JIT)
anyway.
I know that if I define an interface, and only expose the interface but
not the class which implments the interface, I can add a data member to the class without breaking the binary compatibility. If the class itself, rather than the interface is exposed to user, can I still add a data
member to the class without breaking the binary compatibility?
Yes.
What are other restrictions that won't break the binary compatibility?
Don't remove methods, make them private or change their signature if they
are used by the client. You'll get a "MissingMethodE xception" if the JIT
can't find a method that's called in your code.
In pure C++, adding a data member to a class that is exposed to the user will break compatibility.
Yep. There are ways around this, but they usually require some work.
That's one of the reasons why .net was invented.
Niki
"Niki Estner" <ni*********@cu be.net> wrote in
news:ez******** ********@TK2MSF TNGP11.phx.gbl. .. "someone" <so****@somewhe re.com> wrote in news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Suppose that I have a class in an assembly that is delivered to the
user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with
recompiling and relinking. .net applications are just-in-time compiled; There is no "linker". The
kind of tasks that used to be done by the linker are done at runtime (by the
JIT) anyway.
Sorry, that wasn't 100% correct: There is a linker (al.exe) that fuses
modules and resources, but it is rarely used, at least not in a usual
VS-build cycle.
Niki
What about enumeration constants defined? if their value is changed, I
assume that the binary compatibility is broken. I know that this is true in
C++.
"Niki Estner" <ni*********@cu be.net> wrote in message
news:ez******** ********@TK2MSF TNGP11.phx.gbl. .. "someone" <so****@somewhe re.com> wrote in news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Suppose that I have a class in an assembly that is delivered to the
user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with
recompiling and relinking. .net applications are just-in-time compiled; There is no "linker". The
kind of tasks that used to be done by the linker are done at runtime (by the
JIT) anyway.
I know that if I define an interface, and only expose the interface but not the class which implments the interface, I can add a data member to the class without breaking the binary compatibility. If the class itself, rather than the interface is exposed to user, can I still add a data member to the class without breaking the binary compatibility?
Yes.
What are other restrictions that won't break the binary compatibility?
Don't remove methods, make them private or change their signature if they are used by the client. You'll get a "MissingMethodE xception" if the JIT can't find a method that's called in your code.
In pure C++, adding a data member to a class that is exposed to the user will break compatibility.
Yep. There are ways around this, but they usually require some work. That's one of the reasons why .net was invented.
Niki
I'm sorry, my first reply was definitely too short; Unfortunately I didn't
find any good article on the subject; So, here's a short list of things I
that came to my mind right now; In general
- You may safely change default values of data members
- You may safely change all private/internal fields of a class/struct
- You may usually add properties or methods to an existing class or struct
(this only hurts the client if it derives a class from that class, and
happens to add a property/method with the same signature)
- You may usually add data members and events to a class or struct, unless
you use binary serialization in your clients (the binary layout changes with
new data members)
- Removing, renaming or changing the type/signature of public/protected
properties/data members/events/methods can cause clients to crash (however
unlike C++ you'll get something like a "MethodNotFound Exception", and no
memory will be overwritten) if (and only if) the client uses that member
- Removing an interface or changing the base class may hurt clients, if the
client casts to that class/interface
- Changing static constants/enums causes clients to break (didn't think of
that before your post)
Of course this list isn't complete, and there are may still be some cases
where even these rules don't work (e.g. if the client tries to invoke a
non-existing method using late-binding; If you add that method, the client
will behave differently). But I hope that this at least gives you a rough
sketch of what is done at compile-time, and what is done at run-time.
In general, if you expect an assembly to change often, using interfaces for
communication is not a bad idea.
Niki
"someone" <so****@somewhe re.com> wrote in
news:er******** ******@TK2MSFTN GP10.phx.gbl... What about enumeration constants defined? if their value is changed, I assume that the binary compatibility is broken. I know that this is true
in C++.
"Niki Estner" <ni*********@cu be.net> wrote in message news:ez******** ********@TK2MSF TNGP11.phx.gbl. .. "someone" <so****@somewhe re.com> wrote in news:%2******** ********@TK2MSF TNGP11.phx.gbl. .. Suppose that I have a class in an assembly that is delivered to the user, what can I do to change the class so that it doesn't break the binary compatibility? That is, user application can run with recompiling and relinking.
.net applications are just-in-time compiled; There is no "linker". The kind of tasks that used to be done by the linker are done at runtime (by the JIT) anyway.
I know that if I define an interface, and only expose the interface
but not the class which implments the interface, I can add a data member to
the class without breaking the binary compatibility. If the class itself, rather than the interface is exposed to user, can I still add a data member to the class without breaking the binary compatibility?
Yes.
What are other restrictions that won't break the binary compatibility?
Don't remove methods, make them private or change their signature if
they are used by the client. You'll get a "MissingMethodE xception" if the JIT can't find a method that's called in your code.
In pure C++, adding a data member to a class that is exposed to the
user will break compatibility.
Yep. There are ways around this, but they usually require some work. That's one of the reasons why .net was invented.
Niki
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: someone |
last post by:
Suppose that I have a class in an assembly that is delivered to the user,
what can I do to change the class so that it doesn't break the
binary compatibility? That is, user application can run with recompiling
and relinking.
I know that if I define an interface, and only expose the interface but not
the class which implments the interface, I can add a data member to the
class without breaking the binary compatibility. If the class...
|
by: Steven T. Hatton |
last post by:
§27.4.2.1.4 Type ios_base::openmode
Says this about the std::ios::binary openmode flag:
*binary*: perform input and output in binary mode (as opposed to text mode)
And that is basically _all_ it says about it. What the heck does the binary
flag mean?
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in...
|
by: pontifikas |
last post by:
I've created some code, manipulating an Excel application.
Unfortunately this does not work on systems with Other Office distros
than Office XP.
Is there something I can do to ensure compatibility?Some header or
Define
There was an example in MSDN web Doc, but those guys in M$ seem to
have a very good relationship with entropia.... :evil:
|
by: Michi Henning |
last post by:
Hi,
I'm interested in figuring out exactly what kind of change to an assembly
is binary compatible. I've browsed the doc a fair bit, but I can't find a
comprehensive list of what actually constitutes binary compatibility.
Could someone point me at an authoritative list?
One question in particular I am interested in. Consider an object such as this:
class SomeClass
|
by: frostalicious |
last post by:
Used VB.NET (on my client PC) to convert VB6 executable
to .NET executable. Placed the .exe file on a network drive
on my server. From client, ran .NET Wizards "Trust an
Assembly" to make the .exe (on the network drive, on the
server) "Full Trust." From the client, double-click on the
..exe (on the network drive, on the server) and it runs fine.
So far, so good, but...
On the server, where I've installed not VB.NET but .NET
| |
by: DaveP |
last post by:
In Visual Basic 6.0, there was a setting for DLL's that would prevent a
developer from breaking binary compatibility of a DLL by changing a function
name, parameters, etc. Warnings would appear at compile time.
Is there any such thing in .NET? I can't seem to find the same type of
setting, but I do want a way to prevent developers from changing signatures
of functions.
Thanks,
Dave P.
|
by: vim |
last post by:
hello everybody
Plz tell the differance between binary file and ascii
file...............
Thanks
in advance
vim
|
by: zak |
last post by:
we have a suite of products that have a number of shared assemblies. During
development and support the shared assemblies code will change . I want to
control the versioning, so if the code chnages are binary compatable ( i.e
interfaces have not changed) then we can retain the same version number for
the assembly and just
change the hot fix number in the assembly. But how do I know that binary
compatability has been maintained to...
|
by: Simon Woods |
last post by:
Hi
I have a dll ('dll-X') which runs on top of (dependent upon) several
other dlls.
My build environment has a folder structure
binaries
compat-libs
|
by: osama178 |
last post by:
Hi,
What does it mean for an object to be binary compatible? And why
aren't STL objects binary compatible? Any insights, links, resources
for further reading are greatly appreciated.
Thanks.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |