Hot answers tagged

6

How is the API exposed? Through an ordinary .NET interface, or through REST or similar? In the first case, enums are a good choice if you have a limited amount of accepted values. You can check valid values with Enum.IsDefined, you can have inline XML documentation explaining each value, and typo errors are checked by the compiler (and are caught even ...


5

Why build an API on the same server if the Web App is already connecting via the same server to the DB and querying the content. The purpose of the API is to provide a uniform interface for your local apps and your mobile devices to talk to. It is a software layer, not a physical tier. Running the API and the application on the same server is perfectly ...


3

It should be unnecessary to use sessions for this scenario. When the client creates a new Tournament resource (represented in JSON) it can PUT or POST that resource to the server. Which one you choose will depend on who is responsible for the unique identifier for the Tournament. If the client already knows what the URL should be for that Tournament (say it ...


1

I think it's fine. In fact you can use the same application to provide a consistent response. e.g. on my current project the webservice provides HTML responses and JSON responses from the same service, on the same URLs. The means by which it determines what to do and how to respond is purely based on the HTTP Accept headers.


1

You could also go for the middle ground here: use Parse Server + Parse Dashboard. You'll need to get familiar with it to set it up, but it's battle proven, and has many of the features you want: Maintained by Facebook for a very long time, and they're pretty good at authentication It's open source, has a large community, and follows semver, so should be ...


1

If the object represented by your Dictionary has a finite, well-defined set of values that can be identified ahead of time (which seems like it must be true, otherwise you wouldn't be able to use an enum for the key), then why are you using a Dictionary at all? Create a data class or struct that has one field for each possible value. This has several ...


1

Typically there are few improvements you can do to this API, to make it better, Use interfaces Use DI So it would look like, public interface IDeviceConnectionProvider{ DeviceConnection GetConnection(); CloseConnection(DeviceConnection conn); } public class DeviceConnectionProvider : IDeviceConnectionProvider { ...


1

There are lots of Linux kernel APIs. E.g. to name a few: system calls char and block devices (under /dev/) write and read data call ioctl() on the open device netlink sockets sysfs procfs configfs Sometimes objectives determine the suitable API to use. Sometimes it's a bit arbitrary which one to pick. At some point an API was picked by one or more ...



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