Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor - create a Contest class hierarchy with common behaviors #124

Closed
w7sst opened this issue Nov 13, 2022 · 0 comments
Closed

refactor - create a Contest class hierarchy with common behaviors #124

w7sst opened this issue Nov 13, 2022 · 0 comments
Assignees
Labels
technical debt code cleanup, refactoring, improve comments and/or design

Comments

@w7sst
Copy link
Owner

w7sst commented Nov 13, 2022

As part of support ARRL DX Contest, it is time to introduce a common class hierarchy for Contests. This was first discussed in Issue #81. This will remove 4 sets of case statements from the code and use virtual functions instead to access contest-specific behaviors.

We are implementing the following class hierarchy. Note that most method behaviors are shown below and may not match actual code.

classDiagram
TMainForm *-- Contest
TMainForm: +TSimContest SimContest
TMainForm: +string Sent Exchange
TMainForm: +RecvExchTypes TExchTypes
TMainForm: +SetContest(TSimContest)
    Contest<|-- Wpx Contest
    Contest<|-- ARRL Field Day Contest
    Contest<|-- CWOPS CWT Contest
    Contest<|-- CQ WW Contest
    Contest*-- MyStation
    Contest: +LoadCallHistory(user_callsign)
  Contest: +PickStation() integer
  Contest: +GetRecvExchTypes() TExchTypes
  Contest: +GetSentExchTypes() TExchTypes
  Contest: +GetExchange(id, out DxStn)

class Station{
  +TExchTypes SentExchTypes
}

Station<|--MyStation
Station<|--DxStation

    class Wpx Contest{
       +LoadCallHistory(user_callsign)
       +GetExchange(id, out DxStn)
    }
    class ARRL Field Day Contest{
       +LoadCallHistory(user_callsign)
       +GetExchange(id, out DxStn)
    }
    class CWOPS CWT Contest{
       +LoadCallHistory(user_callsign)
       +GetExchange(id, out DxStn)
    }
    class CQ WW Contest{
       +LoadCallHistory(user_callsign)
       +GetRecvExchTypes() TExchTypes
       +GetSentExchTypes() TExchTypes
       +GetExchange(id, out DxStn)
    }
Loading

For additional information, see the Class Hierarchy design discussion #81 .

@w7sst w7sst added the technical debt code cleanup, refactoring, improve comments and/or design label Nov 13, 2022
@w7sst w7sst self-assigned this Nov 13, 2022
w7sst added a commit that referenced this issue Nov 15, 2022
Implements a common class hierarchy to support contests.
contest-specific behaviors will be implemented in the various derived
contests. See Issue #124 for a UML Class Diagram showing this hierarchy.
This refactoring introduces the base TContest class along with 5 derived
subclasses.
@w7sst w7sst closed this as completed Nov 15, 2022
w7sst added a commit that referenced this issue Nov 16, 2022
When fixing #124, call history files were loaded multiple times. This is
not necessary. They are now loaded one time only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt code cleanup, refactoring, improve comments and/or design
Projects
None yet
Development

No branches or pull requests

1 participant