Chapter 16. Developing for reusability
This chapter covers
- Learning to develop with reusability in mind
- Organizing your code via namespace
- Discovering how to layer code
- Reviewing basic application requirements
- Developing reusable components
To me, developing an application is more of an art than a science. The methods and patterns chosen for application construction vary based on many factors, some of which may be completely out of your control.
For example, what if the requirements dictate that the server-side controller either includes or excludes one or more JavaScript modules or files based on security rules? Such a requirement isn’t uncommon in larger role- or permission-based applications. The implications of this type of requirement are rather large because the view changes based on the user role. Knowing how to build extensible applications that can be easily changed over time can be a rewarding experience for the developer and customers alike.
In this chapter, we’ll take on the challenge of developing a relatively large application using a pattern that allows it to be easily extended or modified in the future.