Re: Factory pattern and building object
- From: "Nick Malik [Microsoft]" <nickmalik@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 23:17:25 -0700
<opamail1-googlenews@xxxxxxxxx> wrote in message
news:1127767570.752816.225950@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am creating a FlowChart type GUI application which has several
> diagram items. I have a DiagramItemFactory which creates concrete
> diagram item objects. I call this factory to create diagram items at
> runtime via drag and drop, insert or other. Then I serialize my diagram
> to an XML file. Everything is ok so far.
> My problem is when I open the file a go through the diagram items
> defined in the file, I want to the DiagramItemFactory again to create
> the diagram items for the diagram, but the problem is that
> the factory only creates the default diagram items and the file
> also contains size, color, coordinate and other properties.
Hi Opa,
If you are using the serialization capabilities of the framework, it will
serialize the concrete object and all public properties, not just the
generic object. How are you serializing your object? Also, your snippet
shows the factory but not the definition of the child objects. The
attributes that you use in the code of the objects will determine both how
the objects will be serialized and how they will be deserialized.
See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml01202003.asp
Also, you will get much more specific help on your C# problems by posting to
the microsoft.public.dotnet.languages.csharp newsgroup.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
.
- Follow-Ups:
- Re: Factory pattern and building object
- From: opamail1-googlenews
- Re: Factory pattern and building object
- References:
- Factory pattern and building object
- From: opamail1-googlenews
- Factory pattern and building object
- Prev by Date: Re: Strategy or A factory with Template Method
- Next by Date: Re: Breaking the Last Dependency in C++?
- Previous by thread: Re: Factory pattern and building object
- Next by thread: Re: Factory pattern and building object
- Index(es):
Relevant Pages
|