XML Model Structure
-
Tristan Rhodes wrote:
I just have a feeling
Some friendly advice. Don't base your technical decisions on your feelings. ;) Seriously, in todays world the availability of information eliminates the need to make blind decisions that were common years ago and resulted in the mountains of Technical Debt[^] that exist in the industry today.
led mike
It's past experience as well, and i have looked into it. :P I love the concept of Code Debt. Spent ages trying to get management to see what it was in my last job, but there's only so much you can teach old school VB heads. ^^ [Edit] And if you say you've never looked at a design or section of code and thought "Something is seriously wrong, but i can't put my finger on it.", i think you lie :P
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
Hi Guys, I have a large, and quite complicated model that i origionaly defined using an object hierachy, but the solution has out grown that. I require an in memory model that raises events when it is changed. These events can then be handled by any observing controls which in turn can update themselves. As the model is large, and each control is only interested in one particular part of the Model, i would like to be able to pull out a section of the XML document and observe and apply changes to this block. Idealy i would like to be able to pull an XmlDocument from another XmlDocument and use that, but keeping it synchronised with the parent document. I am limited to the XmlDocument object due to a .Net 2.0 limitation, although the XDocument (And associated LINQ model) would be perfect for what i am trying to achieve as each node raises change events that bubble up the object hierachy. Are there any other solutions anyone else can think of? Cheers Tris
------------------------------- Carrier Bags - 21st Century Tumbleweed.
One word. INotifyPropertyChanged. Have a look at this little puppy - it can be your best friend.
Deja View - the feeling that you've seen this post before.
-
One word. INotifyPropertyChanged. Have a look at this little puppy - it can be your best friend.
Deja View - the feeling that you've seen this post before.
AHHH! I wish i knew about that 4 weeks ago :(
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
AHHH! I wish i knew about that 4 weeks ago :(
------------------------------- Carrier Bags - 21st Century Tumbleweed.
Tristan Rhodes wrote:
I wish i knew about that 4 weeks ago
Sorry. I only just read this thread last night.
Deja View - the feeling that you've seen this post before.
-
Tristan Rhodes wrote:
I wish i knew about that 4 weeks ago
Sorry. I only just read this thread last night.
Deja View - the feeling that you've seen this post before.
No worries. I don't think that it's suited for the problem i had, but it definitely has some uses is some other stuff i was working on. :)
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
No worries. I don't think that it's suited for the problem i had, but it definitely has some uses is some other stuff i was working on. :)
------------------------------- Carrier Bags - 21st Century Tumbleweed.
To be honest, I'm having a little trouble picking up the problem domain from this thread. I'm not sure why you need the XML and why you can't use properties.
Deja View - the feeling that you've seen this post before.
-
To be honest, I'm having a little trouble picking up the problem domain from this thread. I'm not sure why you need the XML and why you can't use properties.
Deja View - the feeling that you've seen this post before.
Well, i'm trying to route all events through a single root object, only wiring up a hierachy of observable lists, trees and properties to do that will be an absolute nightmare as the model is growing almost daily. Additionally, i need to be able to run XPath queries on any part of the model and define some kind of schema to validate against. Which i couldn't do with objects. It's a desktop app if that makes any difference, and the XML would be the state of the solution and everything pretty much revolves around changing that and keeping display parts synchronized with it. Not sure how to describe it beyond that. :)
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
Well, i'm trying to route all events through a single root object, only wiring up a hierachy of observable lists, trees and properties to do that will be an absolute nightmare as the model is growing almost daily. Additionally, i need to be able to run XPath queries on any part of the model and define some kind of schema to validate against. Which i couldn't do with objects. It's a desktop app if that makes any difference, and the XML would be the state of the solution and everything pretty much revolves around changing that and keeping display parts synchronized with it. Not sure how to describe it beyond that. :)
------------------------------- Carrier Bags - 21st Century Tumbleweed.
Short of hashing the different observable portions and then periodically checking to see if the hash has changed, tricky. Although if you implemented this with MVC, then it would be less tricky.
Deja View - the feeling that you've seen this post before.
-
One word. INotifyPropertyChanged. Have a look at this little puppy - it can be your best friend.
Deja View - the feeling that you've seen this post before.
-
Pete O'Hanlon wrote:
INotifyPropertyChanged
That appears to be new in 3.5, yes? I haven't been there yet.
led mike
It's been around since 2.0.
------------------------------- Carrier Bags - 21st Century Tumbleweed.
-
Pete O'Hanlon wrote:
INotifyPropertyChanged
That appears to be new in 3.5, yes? I haven't been there yet.
led mike
led mike wrote:
That appears to be new in 3.5, yes?
.NET 2.0. I've used it to manage Dirty states in classes - it's rather neat.
Deja View - the feeling that you've seen this post before.
-
led mike wrote:
That appears to be new in 3.5, yes?
.NET 2.0. I've used it to manage Dirty states in classes - it's rather neat.
Deja View - the feeling that you've seen this post before.
I still can't find the 2.0 Reference to this puppy?[^] :confused:
System.ComponentModel.INotifyPropertyChanged
Finally! Geez, apparently I have been implementing the IAmAnIdiot interface :doh:
Last modified: 45mins after originally posted --
led mike
-
I still can't find the 2.0 Reference to this puppy?[^] :confused:
System.ComponentModel.INotifyPropertyChanged
Finally! Geez, apparently I have been implementing the IAmAnIdiot interface :doh:
Last modified: 45mins after originally posted --
led mike
led mike wrote:
Geez, apparently I have been implementing the IAmAnIdiot interface
No fair. I copyrighted that one. ;)
Deja View - the feeling that you've seen this post before.