Object Oriented Learning of Prima
Object orientation is a great benefit for programming but also a key for learning.
Prima offers a very large set of objects to the needs of development. As the human brain can group together a quite limited number of objects (four to seven depending on individuals), having a large number of objects can make the whole stuff unmanageable. That is the reason that makes our brain starting with one topic, then a first level of some different groups of things, and then puts at the bottom of each one, the objects that can be a kind of that. This is the way we can manage large sets of objects, buy putting them in a hierarchy. This way the mind works inspired the pyramid principle by B. Minto, as a way to produce documents while validating the ideas.
So, to get off of the numerosity that affects Prima as any other real world tool, we have to depict what type of objects we have, at first.
Prima deals with graphics, so the first decomposition is about the objects that are concerned in the process of building a Prima application:
- Windows are the main objects we deal in Prima, the ones we expect to see starting an application;
- Menus are used to give the user the ability to use the application in some useful way, putting the application functionalities available to the user;
- Widgets add many ways for the user to interact with the application and for the developer to give back results to the user. Examples of widgets are the already seen combo box, the scroll bar, a button;
- Standard dialogs are used to perform some common tasks as opening a file, o putting a message on the screen. In this sense they implement a single functionality, generally using under the hood, more than a single widget.
- Images and shapes also play an important role in Prima; A part of Prima deals with image loading and management and with direct production of drawing.
I would remark again that menus are a separate concept and that what is seen on screen is combination of a window and a menu.
Coming back to our pyramid, in Prima there are about 30 widgets and 10 standard dialogs, but actually that doesn't matter, knowing the common way they are used in an application as widgets or standard dialogs. We would only further expect some specific parameter or event coming naturally from the specific function of the particular standard dialog or widget.