Click here to Skip to main content
15,913,486 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Confused: Bytes Instead of float or Int? Pin
bigals12-Jan-05 11:08
bigals12-Jan-05 11:08 
GeneralProtecting DLL's Pin
bigals11-Jan-05 9:18
bigals11-Jan-05 9:18 
GeneralPropertyGrid Control - Displaying Name property. Pin
Nigel Savidge11-Jan-05 1:17
Nigel Savidge11-Jan-05 1:17 
GeneralChat Channel Sample Pin
zeemalik11-Jan-05 1:00
zeemalik11-Jan-05 1:00 
GeneralRegex Help wanted Pin
Usur10-Jan-05 22:07
Usur10-Jan-05 22:07 
GeneralRunning Application with GUI from a .NET Service Pin
Control Vertex10-Jan-05 18:30
sussControl Vertex10-Jan-05 18:30 
GeneralSide-by-side sharing Pin
mmsspp10-Jan-05 18:09
mmsspp10-Jan-05 18:09 
Generalhelp - detect changed data in form Pin
SGarratt10-Jan-05 12:10
SGarratt10-Jan-05 12:10 
GeneralRe: help - detect changed data in form Pin
Robert Rohde11-Jan-05 0:13
Robert Rohde11-Jan-05 0:13 
GeneralRe: help - detect changed data in form Pin
Anonymous11-Jan-05 13:54
Anonymous11-Jan-05 13:54 
GeneralWindows message handler Pin
RaymondM10-Jan-05 0:17
RaymondM10-Jan-05 0:17 
GeneralLoosing event links by using cut an past Pin
fracalifa8-Jan-05 1:05
fracalifa8-Jan-05 1:05 
GeneralRe: Loosing event links by using cut an past Pin
Robert Rohde8-Jan-05 1:48
Robert Rohde8-Jan-05 1:48 
GeneralNeed help generating tree structure. Pin
fishnet3727-Jan-05 6:02
fishnet3727-Jan-05 6:02 
GeneralRe: Need help generating tree structure. Pin
Ritesh12347-Jan-05 20:43
Ritesh12347-Jan-05 20:43 
GeneralRe: Need help generating tree structure. Pin
Robert Rohde7-Jan-05 21:46
Robert Rohde7-Jan-05 21:46 
GeneralRe: Need help generating tree structure. Pin
Ritesh12349-Jan-05 23:28
Ritesh12349-Jan-05 23:28 
GeneralConverting a HEX value to a DateTime Pin
Stanimir_Stoyanov7-Jan-05 0:18
Stanimir_Stoyanov7-Jan-05 0:18 
GeneralRe: Converting a HEX value to a DateTime Pin
Mike Dimmick7-Jan-05 2:30
Mike Dimmick7-Jan-05 2:30 
Generalwhich testing tool is better Pin
montu33776-Jan-05 23:08
montu33776-Jan-05 23:08 
GeneralCompiling VC++ application on VC7 Pin
_Tom_6-Jan-05 2:18
_Tom_6-Jan-05 2:18 
GeneralAdvice needed for how to use XML DOM Pin
John Guin5-Jan-05 7:19
John Guin5-Jan-05 7:19 
Hello all,

I am writing a simple application which uses an XML file as a log file. It's really nothing more than a simple text editing application.

My question is this: am I better off, from a performance/memory usage standpoint, to create an XmlDocument member of my class so that I have only one document open, but always available, or, should I create a new document as needed, and let it get disposed each time it goes out of scope?

Here's some sample code of what I mean:

public class MyClass
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);

void fn1(XmlDocument aCopy)
{}

void fn2(XmlDocument anotherCopy)
{}

void fn3()
{}
//etc...

}


or


public class MyClass
{


void fn1()
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);
}

void fn2()
{
XmlDocument xdoc = new XmlDocument();
xdoc.Load(pathToFile);
}

void fn3()
//etc...

}

I read all the best practice documents I could find on MSDN, but they only addressed the plusses and minuses of using the DOM vs. SAX, and gave no guidance on the best way of implementing a class using the DOM.

Thanks all,
John Guin
GeneralRe: Advice needed for how to use XML DOM Pin
Charlie Williams6-Jan-05 5:40
Charlie Williams6-Jan-05 5:40 
GeneralInfuriating, Costly Exception Handling Delay Pin
JMPurcell4-Jan-05 18:53
JMPurcell4-Jan-05 18:53 
GeneralRe: Infuriating, Costly Exception Handling Delay Pin
JMPurcell6-Jan-05 8:14
JMPurcell6-Jan-05 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.