-
-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialization with Protobuf-net #36
Comments
Can I take this Issue? |
You mean JsonCacheItem.cs? CacheItem is already a base class in CacheManager.Core.
Sure, go ahead and give it a try 😄 |
Sure, but it is not an interface, and the general question of why you need a base implementation is a good one. Looking at the two current files:
They're nearly identical in terms of the properties they support. Why not make the following ICacheItem interface:
This then simplifies the implementation of Type ValueType { get; } since it will always be TValue. More importantly, by creating a concrete contract for the Type of TValue, you can create a "key-value registry" wrapper around CacheManager to ensure type-safe access to read/write keys-value pairs. |
The point is that The Json Serializer version has similar properties, sure, but the usage and intention is totally different. I'm not even sure if you would even need something like that for the Protobuf implementation |
I agree with @MichaCo , I was thinking along the same lines as @jzabroski but then I realized for all the concrete implementation we have to decorate the attributes differently, so not much to gain on the specific implementations. Another option is to inherit from a abstract class, but I think that would limit any specific CacheItem with no class inheritance. |
Add another serialization option implemented using https://github.com/mgravell/protobuf-net.
Should work the same as the Json serialization
The is up for grabs for now. If someone wants to help, don't worry about the msbuild solution for now, I will take care of that. Create a new xproj under /src called CacheManager.Serialization.Protobuf-net
The text was updated successfully, but these errors were encountered: