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 164177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:41:53+00:00 2026-05-11T11:41:53+00:00

I’m stumped, I have a task where I have to take some markup (json

  • 0

I’m stumped, I have a task where I have to take some markup (json format, not that it really matters) and parse it into an object model. We already have a domain model, its just a matter of running through the markup and creating the relevant objects.

It’s not really suitable for the composite pattern as the objects being created are not similar. Also the markup is not that huge and only goes three levels deep so I’m more interested in an organisational pattern than raw speed. I would really like to achieve the following:

  • Avoid a monster method with lots of nested loops
  • Easy to add new tags/objects in the future
  • Clean easy to read code for the next person who has to modify it

Any suggestions on possible patterns that would be suitable for this? Feel free to give examples in any language, if so inclined.

Regards,

Chris

edit: Here’s an example of the markup – link text

  • 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. 2026-05-11T11:41:53+00:00Added an answer on May 11, 2026 at 11:41 am

    Well if you are looking at standard mark-up such as JSON or XML then you can use ready-to-use low level parsers that are available in most of the programming languages such as .NET C#, Java, Ruby, C++ etc.

    The patterns that such parsers use are combination of AbstractFactory, Composite, Singleton and Builder pattern.

    You can reffer to SAXParser and SAXParser Factory implementation of Java as an example.

    Class Diagram of Builder Pattern on WikiPedia
    (source: wikimedia.org)

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

Sidebar

Related Questions

No related questions found

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.