Lay Them Out
Before we create the plugin and start writing code, let’s think about what might go where. In other words, will this fit all in one function or even one class, and if there are several functions or classes, what goes where? If there are additional classes, what do they need to know about us or each other? If you’ve forgotten some details of functions and objects, check back with Chapter 4, Plugins Have Variables, Functions, and Keywords , and Chapter 5, Plugins Have Objects , for a refresher.
So here are our questions:
-
What goes where? What functions and classes do you need?
-
Why do you need this function (or class)? What is it responsible for?
-
Who else needs to know about this function or class (if anyone)?
One way of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access