octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Update - LaTeX markup project


From: Michael Goffioul
Subject: Re: Update - LaTeX markup project
Date: Tue, 16 Jul 2013 19:05:50 -0400

On Tue, Jul 16, 2013 at 5:58 PM, Andrej Lojdl <address@hidden> wrote:
First of all, I apologize for not sending daily update. I worked on implementing classes. Here is the newest file . Please
feel free to take a look at it and comment, normally if you have time. 

Working and slowly developing ideas how all this work and how it will be integrated, I stumbled upon few problems ( let say obstacles ).

1. Multiple inheritance - ft_render is defined as ft_render :: public text_processor . And now we want to inherit from base_text_render. 
So this can be problem. As I'm informed generally, we want to avoid this ( possible diamond problem ).

Really? I don't think multiple inheritance is a problem. It can be a problem when you deal with specific framework (for instance trying to inherit from 2 QObject-inherited classes), but that's bound to those specific scenario.
 
But, I looked at code and in my 
opinion this wont happen. Because we don't inherit further from ft_render and text_processor don't have common points with our new class 
base_text_render. And it seems that it's not problem if one class is abstract and other regular. Regarding that, I searched for solution and we can use delegation. 

In this case, I don't think the diamond problem will occur.
 
2. Freetype - if interpreter is different form 'latex' and there is no freetype library, we can't make any of these two classes. So we should check around all uses of text_render if it's set to null pointer. Or is there some other solution, you prefer? 

You could have a dummy_text_renderer that would do nothing. Or you could do that with the base_text_renderer class: in this case, base_text_renderer would implement the "dummy" behavior and would not be abstract anymore.
 
3. Interpreter - as I understand with this abstract class and wrapper, we can just type text_render r and then use methods of selected class 
( latex_render or ft_render ) or this should be done some other way? 

Not sure I understand what you mean. The text_renderer class is a wrapper on top of a base_text_renderer object, which delegates all operations to the wrapped object.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]