Skip to main content
added some sample data.
Source Link
Valour
  • 103
  • 4

Edit

Here is some sample incoming data:

char.base { "name": "Valour", "class": "Warrior", "subclass": "Soldier", "race": "Elf", "clan": "wolf", "pretitle": "Testing ", "perlevel": 1000, "tier": 1, "remorts": 7 }
char.vitals { "hp": 100000, "mana": 90000, "moves": 41599 }
comm.tick { }

There is nothing going on with the Model classes. Just some getter properties according to these JSON data.

Edit

Here is some sample incoming data:

char.base { "name": "Valour", "class": "Warrior", "subclass": "Soldier", "race": "Elf", "clan": "wolf", "pretitle": "Testing ", "perlevel": 1000, "tier": 1, "remorts": 7 }
char.vitals { "hp": 100000, "mana": 90000, "moves": 41599 }
comm.tick { }

There is nothing going on with the Model classes. Just some getter properties according to these JSON data.

deleted 90 characters in body; edited title
Source Link
Peilonrayz
  • 44.6k
  • 7
  • 80
  • 158

C# Generic Factory Pattern forpattern to build multiple classesmodels

First of all I was not sure if its the right place to ask this question. I have created aused the factory pattern for one of my projects. I I want to know if this is a good design or if my code can it be improved to make it as fast as possible.

I am not an expert in C#. This is what I came up with after 2 days of research, with lots of rewrites. What I want to ask is:
Is this the right approach? Can I improve it to be faster and safer?

Source Problem: There areis incoming data which includes a JSON data. Data patternstructure is like this:

What I call first char.base part is the module. There There are 12 modules like this and each of them have different properties.

I am not an expert on C#. This is the what I came up with after 2 days of research, lots of rewrites. What I want to ask is: Is this the right approach? Can I improve it to be more fast and safe (also thread-safe)?

C# Generic Factory Pattern for multiple classes

First of all I was not sure if its the right place to ask this question. I have created a factory pattern for one of my projects. I want to know if this is a good design or can it be improved to make it as fast as possible.

Source Problem: There are incoming data which includes a JSON data. Data pattern is like this:

What I call first char.base part is the module. There are 12 modules like this and each of them have different properties.

I am not an expert on C#. This is the what I came up with after 2 days of research, lots of rewrites. What I want to ask is: Is this the right approach? Can I improve it to be more fast and safe (also thread-safe)?

Factory pattern to build multiple models

I have used the factory pattern for one of my projects. I want to know if this is a good design or if my code can be improved to make it as fast as possible.

I am not an expert in C#. This is what I came up with after 2 days of research, with lots of rewrites. What I want to ask is:
Is this the right approach? Can I improve it to be faster and safer?

Source Problem: There is incoming data which includes JSON data. Data structure is like:

What I call first char.base part is the module. There are 12 modules like this and each of them have different properties.

deleted 244 characters in body
Source Link
Valour
  • 103
  • 4

C# Generic Factory Pattern for multiple classes

I am not an expert on C#. This is the what I came up with after 2 days of research, lots of rewrites. I also need to implement a OnUpdated event and couple of model specific events. But stillWhat I couldn't figure out howwant to do itask is: Is this the right way. Maybe adding static eventsapproach? Can I improve it to modelsbe more fast and runing asafe FireEvents() method from Factory? Or some kind of event dictionary on root class(also thread-safe)?

Well any thought are appreciated. Sorry if this is not a right place.

C# Generic Factory Pattern

I am not an expert on C#. This is the what I came up with after 2 days of research, lots of rewrites. I also need to implement a OnUpdated event and couple of model specific events. But still I couldn't figure out how to do it the right way. Maybe adding static events to models and runing a FireEvents() method from Factory? Or some kind of event dictionary on root class?

Well any thought are appreciated. Sorry if this is not a right place.

C# Generic Factory Pattern for multiple classes

I am not an expert on C#. This is the what I came up with after 2 days of research, lots of rewrites. What I want to ask is: Is this the right approach? Can I improve it to be more fast and safe (also thread-safe)?

Post Undeleted by Valour
Post Deleted by Valour
Source Link
Valour
  • 103
  • 4
Loading