CRESS-Surrey / eXtraWidgets

An extension for creating additional interface tabs in the NetLogo GUI and putting custom widgets on them.
MIT License
13 stars 4 forks source link

Relocate custom types to API #37

Closed nicolaspayette closed 10 years ago

nicolaspayette commented 10 years ago

These:

  type WidgetKind = String
  type WidgetKey = String
  type PropertyKey = String
  type PropertyValue = Any
  type WidgetMap = Map[WidgetKey, PropertyMap]
  type PropertyMap = Map[PropertyKey, PropertyValue]

are currently in State. But they're needed in API. Either I add a dependency from API to State or move them to API and add a dependency from State to API. Which is the lesser of two evils?

Or I could decide to use raw Strings in one of these two places, but I find that unpalatable.

nicolaspayette commented 10 years ago

Derp. API already depends on state. There was an arrow missing on my diagram (I should fix this with #38). The question remains, though: is it the right place?

nicolaspayette commented 10 years ago

Given that we want actual widgets to depend only on API, there's a good chance that's where they should go. The widgets will need at least PropertyMap, PropertyKey and PropertyValue.

nicolaspayette commented 10 years ago

Having state depend on API implies including API in the extension class loader box (#38). (And the API jar will get copied to the extension folder, but that should be seamless.