1.16.5 API Static or not?

Discussion in 'Spigot Plugin Development' started by JAPGamer, Jun 11, 2021.

  1. Hey,
    I'm currently working on an API (Core) for my server and asked myself If I should make the API static (every plugin will use the same Instance) or not (every plugin will use its own instance).

    For example (with a MYSQL-Pool):
    -> making the API static (every plugin would use the same MYSQL-Pool)
    -> making the API non-static (every plugin would use its own MYSQL-Pool)

    Thanks in advance.
  2. You can use static for API
  3. For example, if the API contains player data manager which is able to load playerdata from database every plugin would use the same playerdata manager and the same connections, right? Are there some performance disadvantages by only using one instance of every API class?
  4. If the plugins share data managed by the api give everyone the same instance of the api
    • Agree Agree x 1