ethanhuang13 / ladybug

Handle rdar:// links gracefully
MIT License
161 stars 9 forks source link

Radar module #23

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi,

Love the App. Thanks for making it.

The OpenRadar API is great. It might be a good idea to extract it and publish it as a public project on GitHub?

If you do decide to do this then this pull request will help you isolate the OpenRadar API that you have written.

Pull Request Description

  1. Creates a module in your project called Echo
  2. Removes the OpenRadar logic from your App target.
  3. Adds the OpenRadar logic to the Echo target.
screen shot 2018-08-11 at 13 32 42

Your App target now imports Echo.

import Echo
screen shot 2018-08-11 at 13 31 39

If you do decide to publish Echo to your GitHub repo (you can rename it if you like) then you might want to do a few more things.

The persistence layer

At the moment radars are serialised to disk. Echo should not be resposible for persistence. This would allow developers that use echo to choose their own form of persistence, like CoreData for example.

Convenience API

There are things like this in Echo that should probably be removed.

var string: String {
    return String(self.number)
}

What you think?

ethanhuang13 commented 6 years ago

Thanks for the pull request. However, if I would like to extract OpenRadar API part as a module, I would instead just use Sonar.

ethanhuang13 commented 6 years ago

Also, do not change unrelated part in the PR. e.g. Removing UI test target and remove dev team. They both can be proposed on different PRs.

ghost commented 6 years ago

Oh. Why didn't you use Sonar ?

ethanhuang13 commented 6 years ago

It's kinda experiment that see if I can create an useful app without ANY third-party dependency.

ghost commented 6 years ago

You could bring Sonar in as source code, if you want to avoid binary dependencies. Anyway, I thought you did a good job. It might be better than Sonar !

Are you interested in using CoreData as persistence layer in this project?

ethanhuang13 commented 6 years ago

For reference, I did ask @timburks about Open Radar API usage, and he told me:

I don't have a funding source for Open Radar, so I can't guarantee to support the API if costs suddenly spike.

Therefore, I would recommend not to put too much effort on Open Radar API Kit. Unless you find good use cases and doesn't give too much pressure on the API server.

Also, I'm not very satisfied with the search API (it's too simple), therefore no plan on search feature for Ladybug yet.

ethanhuang13 commented 6 years ago

I'm not interested in using Core Data. My goal is to make the persistence format as portable as possible. That's why I just use Codable and store data as JSON.

Since the database usage in Ladybug is greatly limited by how you use Open Radar, this approach is not perfect but probably OK. So far I've only seen user has around 500 radars on Open Radar and the performance has no problem.

ethanhuang13 commented 6 years ago

Anyway, I appreciate the discussion. It helps to clarify many design goals.