kratsg / quora-webdriver

A webdriver to help automate Quora
MIT License
0 stars 0 forks source link

Semantic Naming System #4

Open kratsg opened 10 years ago

kratsg commented 10 years ago

How should I be implementing functions and hierarchy? Which makes more sense in the long run?

  1. Case study 1

    b.quora.user(:user).follow
    b.quora.topic(:topic).follow
  2. Case study 2

    b.quora.follow :user :name
    b.quora.follow :topic :name

Now, in Case study 1, we're defining a user class or topic class that would have added functionality extended and separated by actions. So it follows a browser.quora.type(object).action.

In Case study 2, we're defining a follow class or an upvote class that would have added functionality extended and separated by types. So it follows a browser.quora.action.type :object which might be cleaner.

ryankc33 commented 9 years ago

Case study 1 makes a lot more sense to me: Take object A, and do something with it.

Case study 2 is unintuitive IMO.