Hot answers tagged

6

First, reduce the problem to a test of availabilities "per day". All your examples are using ranges for only one day, but if you also want to support a range like "Monday 10:00 to Wednesday 14:00", break this down into three tests for "Monday 10:00 to 23:59", "Thursday 00:00 to 23:59" and "Wednesday 00:00 to 10:00". For each day, store an interval ...


5

For me it makes more sense as then I don't need to re-parse if errors occur when sending the email for example. In such a case, the main decision criteria are simplicity and performance (which depend not only on the process you are implementing, but also how you do it). For example, when the running time for re-parsing the input file is negligible, ...


5

I think you have complexity because you are starting with over-complication: Paths would be something as: companies/1/departments/1/employees/1/courses/1 companies/1/offices/1/employees/1/courses/1 Instead I would introduce simpler URL scheme like this: GET companies/ Returns a list of companies, for each company return short ...


4

Do they load all the program code into the memory on application startup? NO You can have as many Assemblies in your project as you need. Assemblies are referenced via the using keyword. Unused assemblies are filtered out at the build time itself. For example, you can have two referenced asssemblies as: using System.Windows.Forms; using ...


4

IMHO, I think you're missing the point. First, the REST API and DB performance are unrelated. The REST API is just an interface, it does not define at all how you do stuff under the hood. You can map it to any DB structure you like behind it. Therefore: design you API so that it's easy for the user design your database so that's it can scale reasonably: ...


2

In general, you don't want any implementation details exposed in the API. msw and VoiceofUnreason's answers are both communicating that, so it's important to pick up on. Keep in mind the principle of least astonishment, especially since you're worried about idempotence. Take a look at some of the comments in the article you posted ...


2

Question 1: Is my thinking correct, is "where to cut the hierarchy" a typical engineering decission I need to make? Maybe - I'd be worried that you are going about it backwards, though. So ok, when returning a company, I obviously don't return the whole hierarchy I don't think that's obvious at all. You should be returning representation(s) of ...


2

I think parsing the file and storing the data to a database would be a good idea. It provides a transactional history so you can retry failed messages, audit records sent, and provide reporting. That said, if you have no requirements to support any of those functions and no possibility of having them in the future, writing to a database would just be ...


1

Bloch's rules on optimization are just a variation on "premature optimization is the root of all evil" which, correctly interpreted, means "Measure first, before you optimize. Make sure that your optimization is actually going to give you the performance benefit you are seeking, before you spend the time and money optimizing." I don't necessarily agree with ...


1

Can I suggest you not look at performance this way? You're thinking about it before writing the code. Instead, write the code, get it running, and then find out what the real performance issues are. The chance that you've guessed correctly ahead of time what they are is very small. Here's an example of how to do it. Now, after you've done this, and not ...


1

(since you code in PHP, I am guessing that the Excel file is uploaded in some browser, so is coming from the Internet; if it is not the case, ignore my answer) Is it better practice to store the parsed data in a database first and then use the data however I wish? I believe that yes. The data is coming from an untrusted source, the "bad Internet", so ...



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