Hot answers tagged

5

Preface. Much of this post is for "using C++ lambda as closures to reduce dependency and coupling" in general; therefore it contains advice for such code in general. The sample code here seems to satisfy all advice given here. Using a C++ lambda as a closure in this case is totally acceptable. It is recommended too, since it reduces coupling and header ...


4

is symmetric encryption useful? what are other drawbacks or security vulnerabilities it would introduce? No. The user can just intercept the data after your app has decrypted it. In general, what is a proper way to prevent or make it difficult for users from downloading restful resources? The proper way is to not worry about it. The user can always take ...


4

The diagram should fit your purpose. The "best" practice therefore depend on your intentions and your focus: Is it a high-level design model to show the responsibilities of your core classes? Then, focus on the core interactions between Gamer and GameService. Is it a detailed design for implementing a complex communication layer? Then you may want ...


3

According to the requirement, this data is for viewing only therefore should not be downloaded by user. As you know, viewing something (henceforth called “document”) from internet requires downloading it. You could add extra steps… However, you also need to provide the client the code to do those extra steps… Then the user can take the document after your ...


2

What the user assumes the inputs - trial options - are […] Don't allow the user to make such assumptions. With more that a handful of options, the user will guaranteed get some of them wrong. Instead, let the user give each combination of options they want to use a descriptive name before starting a simulation. Then the user can recall that set of options ...


2

It's not possible to know for sure whether caching your data in Redis would be worthwhile without more information, but: Don't jump to the conclusion that you need to cache the data in Redis. Every dependency you add to a project has a cost. Once you add Redis, you have added one more potential source of problems. When debugging your program, you will now ...


1

I think you are right, you seem to have explored the space and the limitations that the language imposes. The issues you had with the first method is that 1, it didn't have shared attributes and that 2, it required at least one function to be able to store it in the same interface. Shared attributes are a way to store state. If this is your intention then ...


1

I would model this with a state change request table. It would refer to the object and the kind of change (publish, delete, replace content). If the request is approved, the state change is executed. Special consideration would be needed when multiple state change requests are in flight.


Only top voted, non community-wiki answers of a minimum length are eligible