AElga / GhostPeerShareApp

0 stars 0 forks source link

Skeleton #16

Closed jeffmur closed 2 months ago

jeffmur commented 2 months ago

Skeleton Structure :skull_and_crossbones: with Abstract Classes

Cleanup :broom: (remove unused platforms)

Android iOS Linux macOS Windows
Support SDK 16+ Any

Outlines #10 as follows:

Node is a simple abstract timer class. It will calculate the elapsed time between start + stop invocations. This is used primarily how Discover and Advertise inherit from an abstract class.

classDiagram

  class Strategy {
    <<Enumeration>>
    Bluetooth
    Nearby_Connections
    WiFi
    Sonar
  }

  class Manager {
    -Strategy strategy
    discover(strategy): Discover
    advertise(strategy): Advertise
  }

  class Discover {
    String displayName
  }

  class DiscoverWithBluetooth {

  }

  class Advertise {
    String displayName
  }

  class AdvertiseWithBluetooth {

  }

  Manager ..> Strategy: requires
  Manager --> DiscoverWithBluetooth: discover(strategy.bluetooth)
  Manager --> AdvertiseWithBluetooth: advertise(strategy.bluetooth)

  class Node {
    <<Abstract>>
    Duration elapsed
    start(): void
    stop(): void
  }

  DiscoverWithBluetooth ..|> Discover  : implements
  AdvertiseWithBluetooth ..|> Advertise : implements

  Discover --|> Node  : inherits
  Advertise --|> Node  : inherits
MohammedMohiuddin1 commented 2 months ago

LGTM!