On Fri, 17 Sep 1999, Arnd Hanses wrote:
> On 17 Sep 1999 17:56:07 +0200, Lars Gullik Bj°nnes wrote:
>
> >"Arnd Hanses" <[EMAIL PROTECTED]> writes:
> >
> >| It won't help anybody, if you still continue to export all your soon
> >| 10,000 global inter-module interface symbols; even now you have 3026
> >| public symbol exports (functions and variables) in LyX 1.0.x global
> >| name space.
> >
> >As said. 1.0.x is defunct in this discussion. If you want to continue
> >get your facts from 1.1.x it is in that direction that we are going.
>
> And this direction means more features, more flexibility, hence more
> complexity.
>
> My point here is easy maintenance and extensibility:
>
> If you don't strictly reduce the impact of complex details, limiting
> their scope - e.g. by use of 'programming by contract' style door
> guards - to a split apart and shielded region of the (in fact still
> monolithic) code base, producing a bug-free LyX will simply involve too
> much work, too much frustration, because too many people have to take
> too many details into account. You'll need years of LyX experience to
> make things work, you'll have to keep too many details in your mind.
Take a look at the code in (the now old) 1.1.x strand. In particular look
at the files:
src/Popups.h and src/Communicator.h
Popups.h is the *only* header file for all dialog boxes in the gui-indep
code as seen from the core looking towards the frontends. It's currently
129 lines long and over half are comments or whitespace. You couldn't ask
for a blacker box. We have about 1.1 functions per dialog in this class
hiding about 20 dialogs at present in the xforms port with about 12 more
to go and I don't expect the average to increase. Also note that many
dialogs from 1.0 have been merged into tabbed dialogs in the old 1.1.x so
there are more like 30 1.0 dialogs effectively reducing the interface
further. Also note that in 1.0 all the different dialogs were in the
global namespace now they are encapsulated in classes further shrinking
the global namespace clutter and allowing multiple instances of any given
dialog.
Communicator.h is the main interface in the reverse direction. It hides
all the core internals and provides a centralized area for keeping common
code from among the various frontends. This can and probably will be
improved as it is merged into the new 1.1.x strand.
In conjunction with Communicator.h most popups include one or two other
headers for things like string or specific data types like the ParaParams
or PrinterParams. Communicator.h therefore has comments above each
function that describe what its used for, how its used and what extra
header files are needed. This is one area that I hope to improve upon in
the new strand.
The beauty of the above is that it satisfies to a large extent all those
must-haves you listed in a different email. We do get
one-developer->one-module and black-box/programming-by-contract
development. New developers can do a port (of the dialogs) to a different
system without referring to LyX internals or being LyX gurus.
Also note that the core developers generally consider modules to be larger
than just one file. "One concept one file" is certainly desirable but an
entire OS/2 or KDE frontend is a module made up of several such files in
their modules subdirectory.
Most of the rest of the work done in the old 1.1.x strand was also working
toward black-boxing complete subsystems. So while none of the core
developers is particularly interested in using dynamic libraries most of
the principles you are advocating are already being taken into account
whether consciously or not. We started cleaning up and Asger began
rewriting the kernel because the codebase didn't have any distinctly
separated subsystems.
I also suggested dynamic libraries for the frontends about 12 months ago
but someone (SMiyata?) pointed out we'd be better off with the lyx core as
the library and the frontends as the executable. And they're right. But
don't hold your breath waiting to see it in the codebase -- its a guiding
principle and desirable target but it's not going to happen overnight.
Allan. (ARRae)