Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
When do I create a business service aka ConfigurationService.
When the logic in the service has access to a database or filesystem?
When is a class a service?
Is reading an xml file a ConfigurationReader and not ConfigurationService because it has no database access?
Generally I distinguish services from domain objects by the fact that they are stateless. They often (but not always) have access to sources of state (like databases or file systems), but they do not contain it themselves.
So, if ConfigurationReader reads the configuration from the passed xml, and then keeps that configuration in local variables, it's a domain object. If it reads the configuration, and returns the "parsed" configuration objects, then it's a service.
Like the above comment though, this is all semantics, and other people's definition will vary greatly.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
We have to microservices.
How can we use an entity model from one microservice to another microservice without needing to maintain codes on both end?
The goal is to take the jsonData from a microservice and map it to entity model that exist in another microservice.
What is the best practice here?
You will need the assembly that contains the types you want to serialize/deserialize jsons. I think it is ok because when you have one service, you expect it to run autonomously, so, if you provide additional fields it should work (because it will not be affected by the deserialization). Now missing fields, the service will thrown exceptions and it is expected as part of the business.
One option, but not recommended (in my opinion), is to deserialize your json into dynamic and you will be able to navigate on the result as you want. I am not sure about the performance of this.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking for advice and experiences about proper way to create outputs from one separate application to other independent application which must take this value for own implementation conditions. to make it clearer in primitive way for example output application writes some undated value to the text file, and another running application with available path to this file reads it in time loop and if value is found makes some implementation. But I'm trying to find what is more correct way to do the same to pass it from one application directly to another
Message Queing is certainly what you are looking for.
It will let some applications put messages on the queue and some others (or not actually) consume these messages.
https://msdn.microsoft.com/en-us/library/ms711472(v=vs.85).aspx
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I created a small program for one department in our company. I put the C# exe file in one of the shared hard drives on our network. Will there be problems when the exe file accessed by multiple users at the same time?
On the general, yes it can.
On the specific, and as mentioned in the comments by others, what then remains to be asked is
what the application does.
if there is any user-specific functionality or dependency.
if the application can handle concurrency for reads and writes/updates on a DB or file-level(depending on its data sources)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am programing a game and want to save a couple of variables that are bool type. All of the values are stored In class named "Variables". can it be done without using external files if possible?
If you're programming against the Windows Forms model you can look into saving such simple data in the Application settings. This will alleviate some learning curve on serialization.
Take a look here for some insight: Best practice to save application settings in a Windows Forms Application
If the save game data is going to get more complex you'll probably want to start searching for info on XmlSerializer, JSON serialization, or if you need your data concealed from prying eyes: BinarySerializer
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Let's say I have a class named Rectangle and it has some attributes like: color, width, height etc. So this class will for sure describe this object but I also want to save this object to database and later read and create object from db.
My question is should this class also have methods like "SaveRectangle", "GetOneRectangle ", "GetAllRectangles", "EditRectangle" that handles the SQL operations or is there a other good practice?
I would suggest you check out Martin Fowler's "Patterns of Enterprise Architecture".
There are several different patterns for data persistence. The pattern you describe is "Active Record". It can definitely make things easier in the short term but I have found that it often leads to issues when working with many objects.
I typically choose to use a combination of the "Data Mapper" and "Table Data Gateway" patterns that separates storage/retrieval concerns from the objects themselves. That allows me to handle both separately and, possibly, more efficiently.