Back to Blog
![]() We also used Swashbukle (later migrating to NSwag with similar results) to generate the API contract, or OpenAPI specification, this process is also known as Code-First approach.Īs explained in What is Code-First? Code-First is mainly useful in Domain-Driven Design. This allowed us to leverage Entity Framework’s ability to generate the data model (we explored with both CosmosDB and Microsoft SQL Server as our RDBS), including database migrations. ![]() Once we had established the object model, we proceeded to implement it using ASP.NET Core and Entity Framework. In our initial iteration, we began by focusing on the object model, which is often the most enjoyable aspect of API design as it involves creating an abstract model of the business problem (and we developers love to create abstractions of the world!). a database), and the API specification is how developers interact with our object model. Without going in too much detail the object model is the representation of the business entities in our problem, the data model is how those entities are designed in a storage mechanism (ex. When designing an API, it can be helpful to think of it as comprising three distinct layers: the data model, the object model, and the API specification. In this post, we want to share some of the insights we gained from designing and building our API, and we hope you can find it helpful. But, as they say, mistakes are the best teachers, and we learned a lot from this project. Despite having built dozens of APIs throughout our careers, we still encountered some unexpected roadblocks and made some mistakes along the way. We needed to build an API for a new product that even in early prototyping stages could handle a large volume of requests, could be easily maintained, support multiple versions, and be easy to use for developers of all skill levels and its end users. In our latest project, we faced this challenge head-on. However, designing a robust and scalable API is not always easy, even for experienced developers. From simple CRUD operations to complex integrations, APIs allow us to connect our applications with external systems and services seamlessly. ![]() A Technical Journey into API Design-First: Best Practices and Lessons Learned IntroductionĪs software engineers, we all know that APIs, or application programming interfaces, are essential building blocks for modern applications. ![]()
0 Comments
Read More
Leave a Reply. |