471,306 Members | 851 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

Serializing between two projects

Joe
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
Nov 19 '05 #1
8 1296
So long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.

What happened when you tried?

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #2
Joe
Jason,

Thanks for writing.

Class1 and Class2 are not the same class. Class2 uses Class1's properties.
For example, Class2 could have a method call where is needs some information
stored in Class1, i.e.

Sub Method2(TextValue as String, SomeClass1Value as Class1.Property1)

'Do something using the Class1's Property1...

End Sub

I need to pass the information contained in Class1 in Project1 to a method
in Class2 in Project2. I can't allow Project2 to reference Project1.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Jason Kester" wrote:
So long as both classes have the same name and the same public
interface, sure. It should deserialize just fine.

What happened when you tried?

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #3
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how
I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in
different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation

Nov 19 '05 #4
Joe
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
Hello All:

Say I have a solution with two projects (Project1 and Project2) and each
project contains a class (Project1 contains Class1 and Project2 contains
Class2).

The projects don't reference each other. Here's my question: can I
serialize Class1 and use the serialized XML in Class2? How would Class2
de-serialize the XML to retrieve the Class1's properties? I don't see how
I
can do this since Project2 doesn't even know about Class1.

The example in MSDN (the Purchase Order Example) shows how to do this but
with classes in the same project. I want to do it with classes in
different
projects.

TIA,
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #5
Take a look at the sample I posted in reply to the other thread you started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
> Hello All:
>
> Say I have a solution with two projects (Project1 and Project2) and
> each
> project contains a class (Project1 contains Class1 and Project2
> contains
> Class2).
>
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would
> Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see
> how
> I
> can do this since Project2 doesn't even know about Class1.
>
> The example in MSDN (the Purchase Order Example) shows how to do this
> but
> with classes in the same project. I want to do it with classes in
> different
> projects.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #6
Joe
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport? Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
How. I've never done this.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Bruce Barker" wrote:
write your own serializer.

-- bruce (sqlwork.com)
"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:DC**********************************@microsof t.com...
> Hello All:
>
> Say I have a solution with two projects (Project1 and Project2) and
> each
> project contains a class (Project1 contains Class1 and Project2
> contains
> Class2).
>
> The projects don't reference each other. Here's my question: can I
> serialize Class1 and use the serialized XML in Class2? How would
> Class2
> de-serialize the XML to retrieve the Class1's properties? I don't see
> how
> I
> can do this since Project2 doesn't even know about Class1.
>
> The example in MSDN (the Purchase Order Example) shows how to do this
> but
> with classes in the same project. I want to do it with classes in
> different
> projects.
>
> TIA,
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation


Nov 19 '05 #7
Hi Joe,

I can see where this is heading. Read the following articles and references:

http://msdn.microsoft.com/library/de...ialization.asp
http://msdn.microsoft.com/library/de...classtopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:8D**********************************@microsof t.com...
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does
not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport?
Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when
the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you
started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
> How. I've never done this.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Bruce Barker" wrote:
>
>> write your own serializer.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:DC**********************************@microsof t.com...
>> > Hello All:
>> >
>> > Say I have a solution with two projects (Project1 and Project2) and
>> > each
>> > project contains a class (Project1 contains Class1 and Project2
>> > contains
>> > Class2).
>> >
>> > The projects don't reference each other. Here's my question: can I
>> > serialize Class1 and use the serialized XML in Class2? How would
>> > Class2
>> > de-serialize the XML to retrieve the Class1's properties? I don't
>> > see
>> > how
>> > I
>> > can do this since Project2 doesn't even know about Class1.
>> >
>> > The example in MSDN (the Purchase Order Example) shows how to do
>> > this
>> > but
>> > with classes in the same project. I want to do it with classes in
>> > different
>> > projects.
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #8
Joe
Hi Kevin,

Thanks. I've already read these. The examples that they give are for
classes that all exist in the same project. I am asking about serializing a
class in one project and de-serializing it in another project.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Hi Joe,

I can see where this is heading. Read the following articles and references:

http://msdn.microsoft.com/library/de...ialization.asp
http://msdn.microsoft.com/library/de...classtopic.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:8D**********************************@microsof t.com...
Kevin,

Thanks. How would you handle this: DailyReport serializes its data to a
file (or memory stream or whatever). Now, another class (let's call this
class MonthlyReport) - in a different project - wants to de-serialize
DailyReport's data so that it can use it. Assume that MonthlyReport does
not
have the same methods, properties, events, etc as DailyReport. How would
you create the XmlSerializer in the Deserializer method in MonthlyReport?
Is
this even possible since it has different properties, methods, etc than
DailyReport?

I know how to do this when the class that performs the serialization and
de-serialization is the same class; I'm wondering if it can be done when
the
class that serializes is different from the class that de-serializes.

Thanks for all of your help.
--
Joe

VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
"Kevin Spencer" wrote:
Take a look at the sample I posted in reply to the other thread you
started.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"Joe" <jo******@donotspam.yahoo.com> wrote in message
news:C2**********************************@microsof t.com...
> How. I've never done this.
> --
> Joe
>
> VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>
>
> "Bruce Barker" wrote:
>
>> write your own serializer.
>>
>> -- bruce (sqlwork.com)
>>
>>
>> "Joe" <jo******@donotspam.yahoo.com> wrote in message
>> news:DC**********************************@microsof t.com...
>> > Hello All:
>> >
>> > Say I have a solution with two projects (Project1 and Project2) and
>> > each
>> > project contains a class (Project1 contains Class1 and Project2
>> > contains
>> > Class2).
>> >
>> > The projects don't reference each other. Here's my question: can I
>> > serialize Class1 and use the serialized XML in Class2? How would
>> > Class2
>> > de-serialize the XML to retrieve the Class1's properties? I don't
>> > see
>> > how
>> > I
>> > can do this since Project2 doesn't even know about Class1.
>> >
>> > The example in MSDN (the Purchase Order Example) shows how to do
>> > this
>> > but
>> > with classes in the same project. I want to do it with classes in
>> > different
>> > projects.
>> >
>> > TIA,
>> > --
>> > Joe
>> >
>> > VB.NET/C#/ASP.NET/ASP/VB/C++/Web and DB development/VBA Automation
>>
>>
>>


Nov 19 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ivo Bronsveld | last post: by
10 posts views Thread by copx | last post: by
1 post views Thread by Chris | last post: by
2 posts views Thread by Tobias Zimmergren | last post: by
4 posts views Thread by Jason Shohet | last post: by
2 posts views Thread by Simon | last post: by
4 posts views Thread by mookid8000 | last post: by
7 posts views Thread by fjlaga | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.