473,325 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Implementing IFormatter for Custom Formatter

Hi Everyone-

I would like to implement the IFormatter class to create a custom
formatter that essentially does exactly what the
System.Xml.Serialization.XmlSerializer does, but also would allow for
the functionality of ISerializable (GetObjectData, and De-Serialization
Constructor) so that I have more control over the Xml spit out and can
include anything I would like rather than only public variables and the
likes. I don't want to use the SoapFormatter because the Xml coming out
of that is not simple enough for my purposes.

Has anyone implemented IFormatter before and can anyone point me in the
right direction for help with this, I have done quite a bit of searching
and have found very little.

Thanks in advance,

Eric Workman

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
1 7774
Eric,

While the SoapFormatter might seem complex, you really should use it if
you are going to use XML. The reason for this is that if you use
serialization, you have to capture things like internal references, circular
references, etc, etc, which the SoapFormatter handles already. It's a
little bit like a catch 22. If your structure is so simple that you can use
XmlSerializer, then use that. However, if you need more detailed state
information, you want to use XmlSeralizer, without the complexity of the
SoapFormatter, which handles all of the complex situations that might arise.

I would recommend using the SoapFormatter, and applying an XSLT
transform if you need a "simpler" version. Either that, or make it so that
your classes can be serialized just by setting public properties so that you
may use the XmlSerializer class to serialize them.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Eric Workman" <er**********@yahoo.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Hi Everyone-

I would like to implement the IFormatter class to create a custom
formatter that essentially does exactly what the
System.Xml.Serialization.XmlSerializer does, but also would allow for
the functionality of ISerializable (GetObjectData, and De-Serialization
Constructor) so that I have more control over the Xml spit out and can
include anything I would like rather than only public variables and the
likes. I don't want to use the SoapFormatter because the Xml coming out
of that is not simple enough for my purposes.

Has anyone implemented IFormatter before and can anyone point me in the
right direction for help with this, I have done quite a bit of searching
and have found very little.

Thanks in advance,

Eric Workman

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andreas Jung | last post by:
I am trying to write a custom logger with a custom handler: class MyHandler(StreamHandler): pass class Logger: def __init__(self): self._l = logging.getLogger('someident')...
0
by: Scott Ure | last post by:
Hi, I am trying to implement my own formatter that implements and adheres to the standards of the IFormatter interface. I have run into a bit of an issue trying to serialize classes that...
2
by: reycri | last post by:
I have a .Net class (a collection) that already supports serialization. It implements ISerializable... Now, I need it to also support the COM interface IPersistStream. Among other things, I need...
4
by: drewnoakes | last post by:
Hi, I'm developing an application server to which clients will connect over the network. This server has a variety of entry points, and remoting seems well suited for those clients written in...
2
by: Nadav | last post by:
Hi, I am trying to create a custom formatter ( such as the binary formatter ), I can't figure out where do I bind the input Data Stream with the SerializationInfo object info how should i create...
1
by: Justin Crites | last post by:
How does an IFormatter (the serialization interface) know what assemblies are available to it? Let's say you dynamically load Assembly A (by this I mean there is no compile-time dependency),...
0
by: kplkumar | last post by:
In Enterprise Library 2.0, I created a custom formatter as below, public class ERFormatter : LogFormatter { ...... // ________________________________________________________________ The...
0
by: Eniac | last post by:
Hello, I've started using Enterprise Library 2.0 recently and I've encountered a problem that seems to be ... well... undocumented :) Basically, when I set a Trace Listener (formatted event...
3
by: Lowell Alleman | last post by:
Here is the situation: I wrote my own log handler class (derived from logging.Handler) and I want to be able to use it from a logging config file, that is, a config file loaded with the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.