api-designproject-management

Using API for everything?


I'm about to start planning an internal project management tool for my company. One thing that has always led me wondering is APIs.

Would it be seen as bad practice / too inefficient to create a API first and build the actual site using those API calls rather than implement it twice?

Let me know your thoughts!


Solution

  • I completely agree that developing an API will give you a decoupled architecture, and I recommend that.

    However, I feel you should be warned that developing the API first increases your risk of developing the wrong API (PM, by the way, is largely about reducing project risk). You will also be tempted to gold-plate your API-- program features that may go unused, which wastes time. Developing the API in conjunction with the application guarantees that it correctly serves the actual application's or applications' needs. Unless you are confident in the accuracy of and your understanding of the requirements, I suggest programming the API one feature at a time with the application.

    For example, as you develop the application and discover the precise point at which you need to make an API call, create an interface (depending on the technology) that looks exactly like what you need. You can stub that interface to get the app to run, which is a great tool for checking that the app is still on track with user expectations. ("You want it to work like this, right?") Later, you can implement that interface. If by chance requirements suffer alteration, you won't have spent time building now obsolete infrastructure.