Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7163883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:58:37+00:00 2026-05-28T13:58:37+00:00

I am constructing an application which will be able to output data to RSS

  • 0

I am constructing an application which will be able to output data to RSS format and also a more detailed custom XML format. I am having two conflicting approaches to how I would create the object heirarchy.

Option 1 – Build the hierarchy according to what is required by each format (RSS/XML)

FeedItem (RSS properties)
    title
    description
    link
^
|

DetailedFeedItem (Detailed XML properties)
    expirationDate
^
|

Article (Detailed XML Article-specific properties)
    paragraphs

Although this solution works, it feels like the objects are coupled to their visual requirements (RSS/XML).

Option 2 – Build the hierarchy based on a more general abstraction:

Item
    title
    description
    expirationDate

^
|

Article
    paragraphs

This approach seems more flexible and simple to me, but then when I am constructing the RSS, I may have properties that will not be populated (expirationDate, paragraphs). If I go with option 2 I was thinking of creating a class such as RSSMapper which would take an object and map only the necessary properties to the RSS format – e.g., RSSMapper.mapArticle(Article article).

What do you think would be the best way forward?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:58:38+00:00Added an answer on May 28, 2026 at 1:58 pm

    You are right with option 2) (which is basically an Adaptor Pattern).

    Your domain object should be somehow independent from the usage of it. Using a mapping (or adaptor) class to convert the model into a View is the best way to ensure encapsulation and separation of responsibilties. This way, if you want to expose the model in another third format (e.g. HTML?) you just need to create the relevant adaptor without having to change any of the existing code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm constructing an ecommerce application in Symfony, and I have a page which lists
We are constructing an application that will be interacting with Exchange 2007 calendar functions.
i have windows application in which i am constructing dataset with two datatables one
I have an ASP.NET application which tracks statistics by creating and writing to custom
I am having trouble constructing a single XPath statement to return two different sets
I have developed a WebService which will be accessed by 1000's of users at
I have a fairly simple PyQt application in which I'm placing instances of a
I'm constructing a geolocation based application and I'm trying to figure out a way
I have an application which updates a variable about between 5 to 50 times
I'm currently developing a small business database application for which we plan to go

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.