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

  • SEARCH
  • Home
  • 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 8660631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:18:04+00:00 2026-06-12T16:18:04+00:00

I am using a couple of different services to display articles from feeds. They

  • 0

I am using a couple of different services to display articles from feeds. They can all be displayed using one view controller, however I must make a property indicating from which service the user is coming, and to check it every time I want to do something with those articles.

I have experience in this method – and believe me there are a lot of spaghetti code, just to check out which service it is, to decide what do to for each service, it’s a little messy.

So I have 2 options:

1st – re-use the ArticlesViewController for all services, but check from which one is the articles coming from, and do different things based on that when I want to edit those articles.

2nd – make FacebookArticlesViewController,TwitterArticlesViewController, SinaWeiboArticlesViewController (just examples), for each service, and separate the logic.

What do you think is the best approach?

  • 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-06-12T16:18:06+00:00Added an answer on June 12, 2026 at 4:18 pm

    1 st option is better because you do not duplicate any code. In future if you have to change the UI you’ll have to change it in only one place. If you go with second approach, you’ll have to change stuff in all view controllers and theres a big chance you’ll miss something out.

    Also, what you can do is, create a parent article view controller with all common stuff and inherit separate article view controllers only for those types of articles which need lot of customization.

    And if the differences in your articles are largely related to business logic and not UI, it would be better to have separate business layer managing all this stuff. And of course, you can implement same kind of inheritance i mentioned in above paragraph for these business layers.

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

Sidebar

Related Questions

I'm using git to version my home directories on a couple different machines. I'd
I'm using a standard couple of lines of code to retrieve a key from
I'm writing an API wrapper to a couple of different web services. I have
Im using a couple of JSON calls to render data, etc etc. In order
I am using a couple variables that store DateTime.Now for both database and web
In MATLAB I'm using a couple of java routines I've written to interface with
Only began using Haskell a couple of weeks ago - I am attempting to
After a couple of months of using our application (which internally uses Jackrabbit 1.6.4
I a couple of issues using Tablesorter 2.0.3. The first issue is when I
I have a couple of questions about using databases with Jquery Mobile. When you

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.