Throughout this book, we've covered the development of view-oriented applications—applications that the user can interact with directly. Our view-oriented approach, however, doesn't allow us to easily integrate with other services or provide functionalities for native applications. This view-oriented approach often leaves us with hardcoded functionality and makes integrations significantly more difficult. The Yii framework, however, is extremely adaptable and enables us to build API-driven applications rather than view-driven applications. An API reduces the amount of code we have to maintain; if executed properly, it reduces the amount of code that needs to change when we want to add a feature. Ultimately, this allows us to work faster and be more adaptable to changes.
Building an API-driven application also enables us to easily develop both web and native clients that work with our API, thus completely separating view-oriented logic from our application...