Dofactory.com
Dofactory.com
 Back to list
Views:   7.9K
Replies:  1
Archived

Which pattern should I use to create an XML Request?

Hi,

I have a question for the community.
I need to generate the following XML (see below) to issue a request.
Which pattern should I use to create this Xml request, without using Composite Pattern?

 <Customer>
      <Person>
           <Age1/>
           <Age2/>          
      </Person>
       <Address>
            <Location/>
            <City/>
            <Country/>
      </Address> 
</Customer>


I know I could create a Customer class containing a Person and an Address class and then serialize it to XML.
However, how can I create this XML using a pattern?  And which pattern should I use?

Thanks.
Volkan Genç, May 02, 2011
Reply 1
Iterator can be applicable here.

--
Kaushal
http://kaushalp.blogspot,com
Kaushal Patel, May 07, 2011
I'm using the Pattern in Action 4.0 solution and using Entity Framework. I am questioning the way the app implements sorting using dynamic strings. If your entity object field has a different name to the business object field e.g EmployerEntity.LastName Employer.Surname. The app uses Mapper.CS in Data Layer to convert correctly entity.LastName to Surname. But if you sort on UI using &quot;Surname ASC&quot; it will fail; it will work if UI uses &quot;LastName ASC&quot; , so the UI needs an understanding of the Entity/db.
Jan 14, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.