stackoverflow.com stackoverflow.com

How do I structure my Golang game server plugin properly?

So I won't be posting code, as I just need a general approach of how to do this the Go way. The game is played out by AI for both players, kinda like a battle simulator. I have the following parts of my server. EntityManager - handles actions, updates for each entity... Pool - holds the components in slices for utilizing the CPU Cache, also holds other data in slices Handlers - each handler handles a specific action, so an entity can...

stackoverflow.com stackoverflow.com

Design pattern for extracting classes out of data streamed from Excel Rows/Cells, when the data will not always have the same 'shape'/contents?

I'm designing a system that will take in data from spreadsheets, iterate over the data in the spreadsheet, and create business model objects depending on the type of data that is processed to pass further along in the service and carry out additional operations. However, the spreadsheet data is not always the same - for instance, a user could be uploading a spreadsheet containing Car data, another spreadsheet containing Animal data,...

stackoverflow.com stackoverflow.com

Configurative JSON Field Mapping

Introduction Different Business Customers will send data in JSON format to a REST API that we are currently designing. Each Business Customer has an own internal data schema for their data. Rigid API Schema The first idea was to design a rigid REST API which expects the input data to be in a given format that will be the same for all customers. In this approach the Business Customers will have to transform their data into the given...

stackoverflow.com stackoverflow.com

Best way to store complex configuration/settings? SQL vs NoSql

We have a multi-tenant application and each client has its own configuration. At the moment, we use XML files for storing the configuration rules and settings. We have an XSD schema for validation of the XMLs and the whole XML file is mapped to C# objects. Currently, the changes in configuration are done on our side, so clients can't configure anything and they have to reach us for the changes. We want to give clients the possibility...

stackoverflow.com stackoverflow.com

Achievement System based on activities, How to keep track?

I want to build an achievement system that awards certain badges based on conditions, I wonder how to tackle this, if for example, the user has ran 9999 kilometers, if I want to award him a badge when he reaches that 10.0000km, that would mean after each activity, loop all previous activities and take the sum of the distance. It feels like this isn't going to scale well, but what is the other option? Let's say I store the total...

stackoverflow.com stackoverflow.com

Sync request data with db using airflow

I have a sceranio, where i want to use airflow but i am not able to think about the tasks and the best way to do them. I have two table A and B A has two fields id and name B has two fileds as id and sid (PK id and sid, FK is id) The pipeline would run after every 10 mins. I have two apis first one gets the data for table A and second one gets the data for table B. API 1 gets all the data and that data gets stored in table A and then...

stackoverflow.com stackoverflow.com

Is it bad practice to have validation in the application service that checks if a DTO's id is valid or if one of the dto's properties is blank?

I have validation logic in my application service that determines whether the requested operation was a success and if not, the reason why. I question if this is a code smell since it's in the application service and not the domain service and it revolves around checking if a domain model exists, whether or not the property from the dto can be blank, etc. The code is below: public async Task<ResultDTO> CreateEvent(string userId,...

stackoverflow.com stackoverflow.com

Avoiding building URLs on the frontend

I've been working on backends for a while now and only recently started working a bit on the frontend, which got me nearer to an end-to-end REST implementation. More to the point, an important principle of REST is to make it discoverable and consistent, so that the client will know how to deal with resources universally (HATEOAS, JsonApi etc). I've been reading this Google article and there's the following point: If an API uses HTTP...

stackoverflow.com stackoverflow.com

How to separate different folders changes under the same git repository?

I need a bit of professional advice for our big project (currently running). To be more clear, I will describe the situation in detail and provide some more information about the problems we are facing. Let's consider this situation. Our project has a main folder where we initialized our git.It looks this way main-folder/ |___ .git ___ .gitignore ___ package.json ___ other-files ___ oter-folders ___ ProjectName |___...