Skip to content

Abstract ViewController, Implementations, Documentation.#13

Open
Smithor wants to merge 4 commits intoreportmill:masterfrom
Smithor:Feature-ViewControllers
Open

Abstract ViewController, Implementations, Documentation.#13
Smithor wants to merge 4 commits intoreportmill:masterfrom
Smithor:Feature-ViewControllers

Conversation

@Smithor
Copy link
Contributor

@Smithor Smithor commented Mar 16, 2026

I have created an alternate proposal to #9, and I would prefer this one over that one. I had this idea when we were first discussing it, but didn't want to propose it due to the refactoring it would require on your end. But, when I saw that you had decided to create the ViewController class, that provided the perfect opportunity to raise this pull-request.

The idea is to make ViewController an abstract class that makes the core methods that are expected to be overriden more transparent. To keep the ease of use though, it also adds two new implementations, SimpleViewController and DefaultViewController (We could shorten the names to something like SimpleController and DefaultController if that is more preferential. I have no attachment to the names themselves).

SimpleViewController acts as a gateway into the simple use of the library. Right now, it adds the default createUI() implementation, but we could also add a default void implementation for resetUI() as I don't think it is necessarily used in most simple cases. This means that in order to use the library, a user only needs to implement two methods (or 3 right now), and they will be able to use it. It is also more clear, and follows regular Java inheritance expectations (unlike proposal #9, which subverts them by adding the abstract version of the class as a child rather than as the parent).

DefaultViewController is the exact same implementation as what is currently in ViewController, with everything implemented requiring overriding to utilize.

All in all I think this is a much friendlier implementation for newcomers, and makes it much easier to start using the library. I've also tried to add lots of friendly documentation to assist a new user in figuring out the flow path, as its not a normal path to see outside of game design.

Smithor added 2 commits March 13, 2026 15:31
…sting functionality, and made ViewOwner an extension of DefaultViewController to complete the process. Lots of documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant