163

GitHub - TheWizardAndTheWyrd/kotlin-reified-factory: Let's use reified g...

 6 years ago
source link: https://github.com/TheWizardAndTheWyrd/kotlin-reified-factory
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

TheWizardAndTheWyrd/kotlin-reified-factory

master

Go to file

Code

kotlin-reified-factory

Let's use reified generics in Kotlin to implement a simple Factory Method pattern.

Class Hierarchy

BaseClient

Abstract base class.

FooClient

Implements BaseClient.

BarClient

Implements BaseClient.

ClientFactory

Singleton object with a ::create() method to create implementations of BaseClient.

Testing

There is a JUnit test in ClientFactoryTest.

License

Released under the MIT License.

About

Let's use reified generics in `Kotlin` to implement a simple `Factory Method` pattern.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK