Docsity

Lecture Notes on Background Editors: Functions, Properties, and Serializers - Prof. Peter , Study notes of Software Engineering

Toggle sidebar
bg1
Lecture Notes
Background Editors.
Basically, just do everything in functions and properties that you can do with user
interaction. You should be able to do things like select objects, delete them, enumerate
them, create new ones, and so forth.
Why do you need this?
There are innumerable reasons, but here’s one that comes to mind quickly. Suppose
you were trying to teach someone how to use the editor using an on-line course. You
might want to demonstrate some drawings using this tool, and then let the student fill in
the rest.
The biggest challenge is figuring out how to do selections. How do we find out what
is in the drawing, and how do we select it once we know?
Serializers
There are three kinds of serializers, Save/Restore, Print, and Clipboard. Each of these
requires that the drawing be converted into some other form. We will look at two types of
serialization for save and restore, binary and ascii. These two forms require that
serialization be added to the CGraphicList object. The object must be able to serialize
itself. Deserialization is done from outside the object. It would probably be better to
incorporate this into the object itself, but I chose not to. I’ll discuss a better way to do this
in class.
Printing requires only that the object be able to draw itself, as long as the drawing fits
on one page. If the drawing is multiple pages, the drawing must be partitioned and drawn
one page at a time.
Cut and paste require the ability to draw only the selection.

Partial preview of the text

Download Lecture Notes on Background Editors: Functions, Properties, and Serializers - Prof. Peter and more Study notes Software Engineering in PDF only on Docsity!

Lecture Notes

Background Editors.

Basically, just do everything in functions and properties that you can do with user interaction. You should be able to do things like select objects, delete them, enumerate them, create new ones, and so forth.

Why do you need this? There are innumerable reasons, but here’s one that comes to mind quickly. Suppose you were trying to teach someone how to use the editor using an on- line course. You might want to demonstrate some drawings using this tool, and then let the student fill in the rest.

The biggest challenge is figuring out how to do selections. How do we find out what is in the drawing, and how do we select it once we know?

Serializers

There are three kinds of serializers, Save/Restore, Print, and Clipboard. Each of these requires that the drawing be converted into some other form. We will look at two types of serialization for save and restore, binary and ascii. These two forms require that serialization be added to the CGraphicList object. The object must be able to serialize itself. Deserialization is done from outside the object. It would probably be better to incorporate this into the object itself, but I chose not to. I’ll discuss a better way to do this in class.

Printing requires only that the object be able to draw itself, as long as the drawing fits on one page. If the drawing is multiple pages, the drawing must be partitioned and drawn one page at a time.

Cut and paste require the ability to draw only the selection.