Monday, 17 March 2008

I'll probably dedicate a bigger post to this soon, but I wanted to show you a domainmodel, some code and the xml it generates.
What you see here is two attributes that take on quite a bit of work.
EditableBusinessObject implements IEditableObject for you and also allows you to copy the currentvalues to a loadedvalues state.
CreateSerializeSurrogate generates a surrogate class that knows how to deal with loadedvalues and with circular references.
Together, they form the backbone of the client-side of your domainmodel.

Here is an example.

(notice this is the full class, no other properties are here)

  0 [EditableBusinessObject]
  1 [CreateSerializeSurrogate]
  2 [Serializable]
  3 [DataContract(Namespace = "myNamespace", Name = "Person")]
  4  public class Person
  5 {
  6   [DataMember]
  7   public int IntProperty { get; set; }
  9   [DataMember]
  10   public string StringProperty { get; set; }
  12   [DataMember]
  13   public string StringProperty2 { get; set; }
  15   int neverSetInt;
  16   [DataMember]
  17   public int NeverSetInt
  18   {
  19    get
  20    {
  21     return neverSetInt;
  22    }
  23    set { neverSetInt = value; }
  24   }
  26   [DataMember]
  27   public List<string> StringLijst { get; set; }
  29   [DataMember]
  30   public List<int> IntLijst { get; set; }
  32   public Person()
  33   {
  34    StringLijst = new List<string>();
  35    IntLijst = new List<int>();
  36   }
  38 }

Some testcode:
(notice line 16 where we do a endEdit. If we had cancelled, we would've had a proper rollback)

  0    Person p = new Person();
  1    p.IntProperty = 1;
  2    p.StringProperty = "Ruurd";
  3    p.StringProperty2 = "Boeke";
  5    p.StringLijst.Add("a");
  6    p.IntLijst.Add(1);
  8    (p as IEditableBusinessObject).CopyCurrentToLoaded();
  10    (p as IEditableBusinessObject).BeginEdit();
  12    p.IntLijst.Add(2);
  13    p.StringLijst.Add("b");
  14    p.StringProperty = "Ruurd Boeke";
  16    (p as IEditableBusinessObject).EndEdit();
  18    DataContractSerializer s = new DataContractSerializer(p.GetType(), null, int.MaxValue, false, false, new SubstituteDomainDataContractSurrogate());
  20    string outMessage = GetWellFormedToContract(p, s);

And the generated xml:
(notice how the lists and 'StringProperty' are changed, and see the original value).

<PersonSurrogate xmlns:i="" xmlns="myNamespace">
    <IntLijst xmlns:d2p1="">
    <StringLijst xmlns:d2p1="">
    <StringProperty>Ruurd Boeke</StringProperty>
    <OriginalValue_IntLijst xmlns:d2p1="">
    <OriginalValue_StringLijst xmlns:d2p1="">

What is left, is deserializing, maybe propagating the beginedit commands to all children and then create the serverside EF variant.
Oh, and I don't like the originalValue representation. Maybe I'll generate a OriginalValue class to keep it tidy.

Wednesday, 12 November 2008 23:55:11 (Romance Standard Time, UTC+01:00)
I just stumbled on this... I am trying to build a fx in Silverlight to handle the ok/cancel scenario... and was just about resigned to adding in an implementation of IEdtiableObject to all domain objects (extending service proxy generated code).
This looks like it might help... however, does the SL fx contain what is needed for AOP?

Do you have the source for this? Any example working in a Silverlight project?
Friday, 14 November 2008 04:55:21 (Romance Standard Time, UTC+01:00)
PostSharp does have a version that will work for Silverlight.
I am no longer able to spend time on supporting this solution (I'm working in a completely different part of the spectrum now), but yeah, I would think it's very possible.
Thursday, 14 October 2010 14:53:54 (Romance Standard Time, UTC+01:00)
<p>Of the 30 million in the <a href="">vibram fivefingers</a> activities, 2010 non-environment-majors on China walk first stage <a href="">vibram five</a> activities, the poem ended Co., LTD. Offers outdoor products to both the retail price is lucky <a href="">five finger</a> skywalker prize for ¥1980 German professional outdoor shoe in <a href="">vibram shoes</a> on GTX RENEGADE for hiking shoes. They will be wearing this pair of the world’s most powerful boots origin produces the boots top <a href="">five fingers</a> product officially began to walk.Called “outside” of the ID of the winners is walking <a href="">vibram five finger</a> across the big horqin sandy land “green channel”. Inner Mongolia horqin sandy land and <a href="">fivefingers kso</a> liaoning, jilin across three provinces, 92% of eastern Inner Mongolia above <a href="">vibram five fingers</a> distribution in chifeng city, area and the tongliao 5 million square <a href="">vibram five fingers shoes</a> kilometers, ranking first in four sand. Genghis khan’s <a href="">vibram kso</a> brother, and its subordinate subordinates’ called cheap five finger shoes, then formed by <a href="">vibram classic</a> tribe.In the first stage, the activity ended at the second stage, the second phase will start to Tibet, xinjiang, “stand in xinjiang, ningxia, Tibet, shaanxi, gansu, qinghai and within the <a href="">vibram flow</a> scope of land.</p>
<p>If you want to take part in outdoor activities, persistent and very love this <a href="">vibram fivefingers kso</a> sport, so choose cheap vibram is very important. A set of suitable equipment can indeed for our outdoor activities to provide protection, let us be more close to nature, feel nature.We choose to suit <a href="">5fingers</a> oneself is suitable for environmental equipment, so we first concern is the applicability of the equipment, rather than spend less money for price, event, although is good, but usually sale <a href="">five finger speed</a> is reality, the most expensive sometimes are not is most appropriate. There is not expected to equipment can be armed to the teeth. A bite to eat dinner.</p>
<p><a href="">MBT shoes</a> have become increasingly popular. Because of its tremendous role to humans. <a href="">mbt walking shoes</a> not only fashionable, but also healthy. I think this is more important is fashion. Swiss <a href="">mbt shoes sale</a>, Karl Mueller invented. His invention came to the United Kingdom. In tourism this journey, it can be found wearing <a href="">mbt sale</a> can easily get ahead, he who is like a walk in the soft grass. It takes years of research and development, <a href="">mbt shoes review</a> Sale market development began in 1996, selling over one million every year is growing <a href="">mbt footwear</a> rapidly.<a href=""></a> </p>
Thursday, 14 October 2010 14:57:04 (Romance Standard Time, UTC+01:00)
3_103.html"><strong> </strong></a> are made more unique by the inclusion of a large wooden button with the Ugg logo on it and an elastic band closure. So it allows you to wear t
Just as with the <a href=""><strong>UGG boots</strong></a> the new calf high boot that this <a href=""><strong>Ugg Australia</strong></a> company have introduced the Bailey Button offers the same level of comfort. Certainly for women who are looking for a pair of <a href=""><strong>UGG sale</strong></a> to team with jeans or a long skirt these are ideal.But as you will soon discover these <a href=" with this detailing on shown or you can undo the button and then turn the top over to create a cuff.With all the boots included in <a href=""><strong>Cheap UGG boots</strong></a> Australia’s Classic Collection range the <a href=""><strong>UGG bailey button</strong></a> is lined with twin faced Grade A sheepskin. Also there is the traditional suede heel guard to ensure that not only is this area protected but offers this part of the <a href=""><strong>UGG boots sale</strong></a> support. Plus within the <a href=""><strong>UGG classic cardy</strong></a> you find each pair has sock liners that are made from sheepskin PU foam so increasing the level of comfort a person feels when wearing <a href=""><strong>UGG short boots</strong></a>.<a href=""><strong>zigtech shoes</strong></a> is very unique. It uses an innovative lightweight foam materials,<a href=""><strong>ZigTech trainers</strong></a> are designed to help you run further and faster, allowing you to train while using their unique <a href=""><strong>Easytone shoes</strong></a> harder for longer with reduced risk of injury. They do this by providing lots of cushioning Yesterday we saw the promo video featuring Thierry Henry and Lewis Hamilton talking about the trainers. So today we’re looking at the latest technical video released by Reebok to explain what <a href=""><strong>Discount Reebok Easytone</strong></a> is and how the <a href=""><strong>zigtech sale</strong></a> sole the Slinky-esque midsole/outsole that is said to reduce muscle wear and transfer energy. <a href=""><strong>Reebok zigtech shoes</strong></a> Stadium bring an innovative technology shoes- <a href=""><strong>Reebok easytone shoes</strong></a> training run. We series, is the best <a href=""><strong>Easy tone shoes</strong></a> sport technology to date. It can reduce 20% of the leg muscle fatigue and wear, in order to cultivate strength and degree of difficulty is significantly increased.<a href=""><strong>MBT shoes</strong></a> effect abdominal, leg and buttock <a href=""><strong>Cheap mbt shoes</strong></a> looks sunny, so it is a good choice <a href=""><strong>MBT shoes sale</strong></a> believe that human fitness majestic, <a href=""><strong>Skecher Shape Ups</strong></a> walk to a large extent. This view wholesale <a href=""><strong>Discount MBT Shoes</strong></a> a number of scientific ,Therefore, majestic mbt shoes and strengthen peoples understanding <a href=""><strong>shape ups Shoes</strong></a> .in <a href=""><strong>shape up skechers</strong></a> through disseminate the majestic <a href=""><strong>shape ups discount</strong></a> ideas and concepts.
Friday, 15 October 2010 08:53:39 (Romance Standard Time, UTC+01:00)
href="">Reebok Easytone Shoes</a> syndication. And then there are those who are having <a href="">Discount Reebok zigtech</a> trouble getting out of their own way.The folks who are not succeeding are the ones whose first question is “where do I find a good deal?” Early stage syndicators think they need to find a great deal, then raise capital, and they will be on their way toward success and profit. I usually counter that with some tough love and a reality check. Instead of looking for deals and Reebok shoes, a prudent <a href="">Reebok EasyTone</a> syndicator needs to put the horse in front of the deal, and start with the question of how to raise capital.
Friday, 15 October 2010 08:53:48 (Romance Standard Time, UTC+01:00)
back pain and lumbosacral joint.Moreover, the girls who wear high heels early will lead to <a href=""><strong>Discount Mbt Shoes</strong></a> the developing pelvic tilt, which make the <a href=""><strong>Mbt shoes clearance</strong></a>, is demanding.However, they are not only for people on their feet but for anyone who wants to wear a pair of comfortable <a href=""><strong>Mbt shoes outlet</strong></a> that takes the pain away from your body when you are standing and walking. That’s why you need to wear <a href=""><strong>MBT Sandals Shoes</strong></a>.
Friday, 22 October 2010 09:20:48 (Romance Standard Time, UTC+01:00)
With the coming of Nike Air Max series,and the unique design and fashion style have made more and more young people love them. In Nike air max 2010,nike company had been released their newest product, it is called Nike Air Max 2009,which is also the latest nike air max 90 series,the shoes is made from a synthetic leather which using the latest technology to give a more smooth surface of the shoe. A non-pressurized forefoot and heel Air-Sole unit is integrated into the Cushlon midsole foam for a responsive ride.n our online stores,we provide Air Max 2009.
Friday, 22 October 2010 09:20:55 (Romance Standard Time, UTC+01:00)
<a href=""><strong>Shape Ups Shoes</strong></a> come in different colors and designs. They <a href=""><strong>Skechers Shape Ups</strong></a> the same midsole and outsole, so they should fit and feel the same. <a href=""><strong>Skechers Shape up Shoes</strong></a> also come in extra wide widths in select styles for men and women.<a href=""><strong>Skechers Shape Ups Shoes</strong></a> While You Walk
Tuesday, 26 October 2010 02:44:56 (Romance Standard Time, UTC+01:00)
href="">Reebok ZigTech</a> tests the shoes on real runners who fill in a detailed questionnaire at the start, mid-way and end of 300-mile increments. They’re light, flexible and so comfortable. <a href="">Reebok ZigTech shoes</a> footwear, training longer just got easier.<a href="">Reebok Easytone Shoes</a> has the top technology which uses shoes’ energy and transfers it horizontally. ZigTech helps to transfer weight through the whole range of motion by pushing the force of the strike through to the front of your foot. <a href="">Discount Reebok zigtech</a> footwear is designed to protect your feet and return energy to the athlete for a soft and springy ride. The foam is lightweight. Forefoot flex grooves for added <a href="">Reebok EasyTone</a> flexibility. This ultimately enables athletes to stay healthier during in this season.<br>
Tuesday, 26 October 2010 02:45:19 (Romance Standard Time, UTC+01:00)
href=""><strong>Cheap mbt shoes</strong></a> is not too high, if the heel is higher than 3.5 cm, it will increase the risk of lumbar lordosis and lumbosacral angle, which easily lead to fatigue and lower back pain and lumbosacral joint.Moreover, the girls who wear high heels early will lead to <a href=""><strong>Discount Mbt Shoes</strong></a> the developing pelvic tilt, which make the <a href=""><strong>Mbt shoes clearance</strong></a>, is demanding.However, they are not only for people on their feet but for anyone who wants to wear a pair of comfortable <a href=""><strong>Mbt shoes outlet</strong></a> that takes the pain away from your body when you are standing and walking. That’s why you need to wear <a href=""><strong>MBT Sandals Shoes</strong></a>.
Thursday, 04 November 2010 04:41:52 (Romance Standard Time, UTC+01:00)
Comments are closed.