Skip to main content
added 534 characters in body
Source Link
BeeFriedman
  • 535
  • 1
  • 5
  • 14

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON, then stores it in an object and all objects are then stored in an object list. This class has 2 public methods, 1 private method and about 200 lines of code.
  • I then have a static class that loops through the object list and calculates the results basebased on each objects values. This class have 2 public methods and about 200 lines of code.
  • I then have a static class that stores the results in the database. This class has 1 public method and 25 lines of code.
  • And I have the main class that calls everything. This only has the main method and line 10 lines of code.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

Update
My question is not if I should use objects (non-static) classes instead of static classes, I have no way to reuse the classes so there is no reason to make it non-static. My question is if I should remove some classes and turn them into methods in the Main class.

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON, then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON, then stores it in an object and all objects are then stored in an object list. This class has 2 public methods, 1 private method and about 200 lines of code.
  • I then have a static class that loops through the object list and calculates the results based on each objects values. This class have 2 public methods and about 200 lines of code.
  • I then have a static class that stores the results in the database. This class has 1 public method and 25 lines of code.
  • And I have the main class that calls everything. This only has the main method and line 10 lines of code.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

Update
My question is not if I should use objects (non-static) classes instead of static classes, I have no way to reuse the classes so there is no reason to make it non-static. My question is if I should remove some classes and turn them into methods in the Main class.

please don't use code formatting for emphasis, cf. https://meta.stackexchange.com/q/135112/295232
Source Link
Glorfindel
  • 3.2k
  • 6
  • 28
  • 34

I am currently building a c#C# application that gets JSONJSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSONJSON, then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

I am currently building a c# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

I am currently building a C# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON, then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

added 29 characters in body
Source Link
BeeFriedman
  • 535
  • 1
  • 5
  • 14

I am currently building a c# application that gets JSON anddata then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

I am currently building a c# application that gets JSON and calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method instead of having a separate static class for it, am I?

I am currently building a c# application that gets JSON data then it calculates something then stores the results in a database, what is the proper way to design the application.

This is how it's now

  • I have a static class that gets and parses the JSON then stores it in an object and all objects are then stored in an object list.
  • I then have a static class that loops through the object list and calculates the results base on each objects values.
  • I then have a static class that stores the results in the database.
  • And I have the main class that calls everything.

I think that I am overusing the static classes and could replace one or a couple with simple method (in the main class) instead of having a separate static class for it, am I?

Source Link
BeeFriedman
  • 535
  • 1
  • 5
  • 14
Loading