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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:39:17+00:00 2026-05-26T10:39:17+00:00

I am creating simple web-service client in Objective-C and found that creating separate class

  • 0

I am creating simple web-service client in Objective-C and found that creating separate class for each kind of web-service’s response could be overkill. Perhaps this because Objective-C has two files – H&M.

Here is sample of responses from web-service:

{"name": "John", status: "OK"}

or

{"total": "5500", status: "OK"}

or more complex

{"location": {"x": "140", "y": "90", "z": "0"}, 
 "color": "red", status: "OK"}

I want to create separate class for each response, e.g. NameResponse, TotalResponse, LocationInfoResponse and subclass them from Response class.

I am sure in Java that would be quite compact to create some classes, but not sure about Objective-C.

UPDATE 1
One reason to use classes over NSDictionary is that code is more safe and better defined, e.g.:

I think

response.name

is better than

json valueForKey: "name"

Isn’t it?

Please put how would you do in the answer and is a class per each response is overkill in this case?

  • 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-26T10:39:17+00:00Added an answer on May 26, 2026 at 10:39 am

    Having your data model clearly specified is never overkill. And formal data types are the best kind of specification – they’re already implemented!

    If the web service responses are transferred between layers of your application, use classes. If the scope of their use is small enough, a NSDictionary might be acceptable.

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

Sidebar

Related Questions

i am creating a simple SOAP web service. i am to ensure that it
I am interested in creating a simple web application that will take in user
While creating a simple client for a REST service which I have stubbed out,
I'm creating a basic web service in asp.net/c# using simple ASMX services. When I
I've written a simple web service that converts a word doc to a pdf.
I created a simple WCF web service that has one method: SubmitTicket(flightticket ft, string
I am creating a simple SOAP web service using a SLSB and JAX-WS annotations.
I've been supplied a web service by a colleague that I tested by creating
I'm creating a simple API that creates typed classes based on JSON data that
I'm creating a simple tag system that allows me to link a tag to

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.