macMikey / 4d-google-workspace

manage google docs and sheets
Other
4 stars 2 forks source link

work out lineage of classes #4

Closed macMikey closed 4 years ago

macMikey commented 4 years ago

especially because we can embed objects in other objects after the fact, the main thing we're missing will be access to being able to call the functions within the objects. we have some potential issues w/ inheritence b/c tokens will expire and need to be redone for everyone i guess we could have a google session class and then have the spreadsheets inherit from that. obviously sheets would inherit spreadsheets. then we have to work out the calls - now we are instantiating them in effectively reverse order.

macMikey commented 4 years ago

in this context, unlike merggoole, it seems like there isn't any point to trying to keep the sheets separate. then again, there was a regex for getting a sheet id.

macMikey commented 4 years ago

maybe another way to do this would be:

  1. generate a comms object
  2. sheet extends that object
  3. sheet does its thing
  4. parent (that owns comms and sheet) checks to see if comms expired and if so updates parent comms and any other child objects
macMikey commented 4 years ago

passing a pointer to update comms might help

macMikey commented 4 years ago
  1. create comms object
  2. create spreadsheet, passing pointer to comms
  3. spreadsheet calls header function using pointer to comms data
  4. if comms data is old, pointer is used to update comms data this gets us around not being able to use a pointer to the comms functions but having access to the comms data via a pointer.
macMikey commented 4 years ago

Solution?

per vdl and KM conversation:

It seems that we should maybe do the following:

since comms doesn't have any properties, by extending it we don't need to do anything else per se We then pass the auth object to every spreadsheet object, and we can then refer to the auth properties because the object is a pointer. The comms functions are automagically incorporated by reference, like a submodule, and thus we just call the functions When we need auth, we just use the auth properties, which are incorporated.

macMikey commented 4 years ago

v. 0.0.0.4 0b24a992e1e6a5fd35ac1940d7f3409f35b91018