Tag Info

Hot answers tagged

3

What's an API ? It is an interface by definition. Consider the software you're using as a blackbox. You're not supposed to know how things are done internally, nor are you supposed to want that, or you would just build things yourself. Besides, trying to extend an API class yourself may break the tool's behaviour (which, once again, you don't really know). ...


2

The answer to your question depends on the definition of "good" in the question "what are some good ways to separate APIs from implementation of ..." If "good" means "pragmatic easy to implement for you as manufecturer of the api" this might be helpful: since you are using java where jar-libraries are loaded at runtime i would suggest a slightly different ...


1

I think it would help if you clarified how much difference in APIs there are. eg. Could ytou be using 2 location services where one takes lat/long co-ordinates, and the other XY co-ords; or are they more different like a location service and a pizza-ordering service? Either way, your best bet is a message passing architecture. You have a broker or message ...


1

ASP.NET Identity comes in two flavors: You can use your own signin, which will essentially become a 'private IDP' for you. You an use external IDPs (Facebook, Twitter, LinkedIn, etc.) via ASP.NET Identity, which will handle all the complexity. I am not sure which option is "nothing for Production" in your opinion. If you can explain the concerns, the ...


1

Not sure where you read that interfaces are more problematic to use or maintain. You can only inherit from one base class, but you can implement as many interfaces as you want, so interfaces are inherently more flexible. E.g. Consider what would happen if Closeable and Readable were abstract classes; you'd have no way of making, say, a FileReader that ...


1

Enums are a good idea If you'll provide this code via dll (good idea for me), I'd recommend not to change them into enum class and not no throw the exception, because these are C++ only features, and users will be not able to use your dll in C# for example If these enums will be used as a real register address (or offset) it would be better to initialize ...


1

Enums are always good to use, since they make code easier to understand. But, you have several problems there : if your code snipet is in a header, then the namespace must have a name I would use strongly typed enum enum class, instead of just enum your enum values are not descriptive enough, and sounds very generic. You may want to give better names, ...


1

Some resources contain only a single item. Good examples would be everything for which you don't need an ID to find out what data to render. Very common for example would be the Login resource. You have (from the users and browsers view) only a single login. You can create it, you can destroy it but you won't have an index action with several Logins to ...



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