Is Meta the place to ask those vague SO questions?

Discussion in 'iOS Programming' started by patent10021, Aug 31, 2016.

  1. patent10021 macrumors 68030

    patent10021

    Joined:
    Apr 23, 2004
    #1
    Is SO Meta the place to ask those very general questions that always get down-voted on SO or is it easy to get down voted on Meta too?

    I need to ask a lot of general how to questions for some particular projects first before I can ask for code specific solutions.

    Just as an example for this post.

    Meta: How would you approach changing your code which is currently written to read then display mock data to eventually receive and display live server data?

    progresses to the more specific question...

    StackOverFlow: How would I populate a WKInterfaceLabel with live weather data?
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    It sounds like you're asking a meta Meta question. Is there a Meta Meta SO place to ask them?

    That may sound frivolous, but why not try starting on Meta, and see what happens. Try with a few questions first, as sort of "mock data" or "trial balloon".


    Taking the specific example:

    How would you approach changing your code which is currently written to read then display mock data to eventually receive and display live server data?
    I would design the mock data supplier so it's either a class or protocol, and the main code that consumes the data uses only that interface to access the data. Then the live data supplier will be written to the same interface; either a subclass or a protocol implementation.

    The key point to see here is that the interface between the main code and the data supplier is defined first, and is unvarying. As long as the interface meets all the needs of the consumer, and the supplier is sufficiently abstracted from the implementation, this design will work regardless of whether the consumer is a WKInterfaceLabel or the supplier is weather data.

    I can tell you from experience that you'll have to go through several iterations of the interface before you get it right. You'll always leave out some needed feature, which you won't discover until you try using it in the data consumer classes. You may also start out by defining too many methods, properties, etc. and they don't get used, or are used infrequently. You may also end up making design changes so the eventual live data (a server) is more easily able to implement the interface. In other words, you make some concessions on pure abstraction because it simplifies the real implementation, and is a "don't-care" condition for the mock data.

    Finally, I might not make the WKInterfaceLabel directly aware of its data source. There might be a coordinator level that manages multiple labels, and that's where the awareness of the data source resides. You didn't describe the intended design well enough to decide that or not, but it's worth considering if there are lots of labels that change together as a group.


    The general question is a pretty ordinary object-oriented design question. The fundamental principles are abstraction and encapsulation.
     
  3. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #3
    Let me turn this inside out.

    I usually write the data layer first, before the UI or presentation layer. I drive the data layer with unit tests until I believe that it works. So I have a working data provider that loads the live weather data. Then when I write the UI layer I don't have to mess with mock data. I just use the functional data provider.
     
  4. eventailapp macrumors member

    eventailapp

    Joined:
    Jan 7, 2016
    #4
    The short answer is: No. Meta is there to ask questions about the Stack Overflow itself. If you want to ask a more generic programming question try http://programmers.stackexchange.com/
     
  5. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #5
    You could ask your general questions here. If they get answered, you can discuss the answers until you think you have enough detail to ask another more specific question.
     
  6. patent10021 thread starter macrumors 68030

    patent10021

    Joined:
    Apr 23, 2004

Share This Page