What Is Modular Development? | Modular Apps in MATLAB, Part 1
From the series: Modular Apps in MATLAB
What is modular development and when does it become essential for MATLAB Apps?
As your apps grow, coding can become tedious. Split your apps into small, focused pieces of work that are easy to maintain and test. This video will introduce you to modularization techniques using MATLAB® and App Designer.
Published: 14 Jun 2022
In this series, we're teaching modularization techniques to efficiently develop advanced applications in MATLAB and App Designer. Modularization will enable you to develop apps that are scalable, robust, testable, and well-organized. In this first video, we'll explain why modularization is essential and how it enables you to create small, focused pieces of work that are easy to maintain.
Applications can grow large to as many as tens of thousands of lines of code. Without proper structure, the coding becomes tedious. Identifying and navigating errors becomes difficult. Small changes cause unintended and hard to discover behavior, and collisions and conflicts become more common when developing in teams.
The solution to these problems begins with modularization. Modularization means structuring your code as separable, focused units differing in size and function, each having specific responsibilities. This enables you to organize your work and develop unit tests for each module. Testing is essential to scalable, robust and maintainable software. A well-built foundation is essential to developing modular applications.
Start by isolating your algorithms and data management from the user interface of your application. Your critical algorithms need to remain stable and robust, regardless of changes to the visual part of the application. We call these core algorithms the model. It's the code that imports data, does required calculations, and keeps track of user changes throughout the app.
Keeping your user interface modular is also essential. The interface of your application is built with view and control components with easily separable goals and uses. All of them need access to the data model, but we're going to keep the paths separate.
View components retrieve a single instance of data to display. The user can interact with control components to manipulate and make certain changes to the model, depending on their configuration. When the model has changed, view components should be notified, so they can update automatically. Isolated data models and independent UI components keep your applications fast, manageable, and testable.
In the next video, we will show you how to begin developing a data model, and then in later videos you will learn how to develop custom app components and integrate all of this into a single app. For more information about building apps in MATLAB check out the links in the description. There you can also find links to our training classes and consulting services in the app development space. Thank you for watching.