Replies: 1 comment 1 reply
-
Hello! Thanks for the post and your valuable feedback. I came up with I like the appeal of GenericHosts, they are very .NETy! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I happened across this project while looking for C# implementations of Minecraft Server. I need to do some pretty unique things for my use case and trying to figure out how to make them work in Java/Kotlin and building against Forge has not been a fun time to say the least.
As a .NET developer myself, I was digging through your codebase to see what you were doing with it and ran across some interesting design decisions that are outside what I would have expected. I don't want to come in here and sound like I'm saying "this is wrong, change it for my sake!" Instead, I hope to gain an understanding the design decisions here in the hopes that I may learn something from outside of the Microsoft world and become a better programmer for it. Exposure to new ideas and patterns is one of the best ways to improve language skills, after all.
Firstly, things seem designed to be catered to existing Bukkit/Spigot developers. For instance, with your plugin library, you have a
PluginAttribute
which works almost exactly like the one found in the Spigot API. You also use anInjectAttribute
on properties to inject dependencies, much in the same way as you would with Bukkit/Spigot. What was the decision behind going with this rather than going with something more traditional for C#? As an example of what I mean, the Remora.Plugins library is a good example of a small, lightweight library which behaves as more of what I would expect for something in the C# world (with the added benefit of getting rid of the necessity for reflecting class attributes).Secondly, I noticed you rolled your own versions of classes like a ServiceProvider and a Logger. Any particular reason for doing this instead of working with the ones built in to the
Microsoft.Extensions.DependencyInjection
andMicrosoft.Extensions.Logging
namespaces, respectively? These tie in very nicely with GenericHosts (Microsoft.Extensions.Hosting
) which is now the preferred way to handle long-running applications.Thanks for your time and the opportunity to hear your thoughts!
Edit: Using a GenericHost would also resolve #102 since plugins would be able to define their own dependencies and provide them to the overall server's ServiceProvider. This would also allow for easy sharing between plugins, such as if one plugin acted as a library for other plugins as some do in the Spigot world.
Beta Was this translation helpful? Give feedback.
All reactions