Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding late binding.
Message
 
To
01/02/2005 15:12:07
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00982828
Message ID:
00982919
Views:
35
Why do you want to avoid reflection? For most applications the penalty will not be too great.

Also, have you considered copying the objects directly?
// create a copy of the bizobj
IFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
if (bizobj != null)
{
// Save a binary copy of the original information
// for use to restore the original info when the user
// clicks on the cancel button
      formatter.Serialize(stream, bizobj);
}
...
// this is how to restore the copy
if(stream.Length > 0)
{
	stream.Position = 0;
	bizobjCopy = (BizObj)formatter.Deserialize(stream));
}				
Now, there might be some problems doing it this way because in MM.NET the business object is derived from Component and your business objects have to be marked serializable. And you might have extra work to do if your business objects are tied together with an eventing mechanism instead of collections. But its worth a try before you start coding all the details.

See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtsksavingpropertiesofyourcontrol.asp

>Hi,
>
>Is their in this case an other approach possible to achieve the same effect by means of abstract classes or interfaces without the performance penalty of late binding?
>
>
>Mark
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform