[Lazarus] Java's Document & Elements model

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Thu Jun 26 17:09:48 CEST 2008


On Thu, Jun 26, 2008 at 9:57 AM, Graeme Geldenhuys
<graemeg.lists at gmail.com> wrote:
> As for SynEdit being the only component that could benefit from it. I
> think not. :) SynEdit, TMemo, TRichView, THTMLView (or whatever it's
> called to display HTML like in the CHM Help Viewer), LazReport could
> also use it. ListBox, ComboBox could use it (though I personally think
> it's madness to have 100's or 1000's of items in those. StringGrid is
> another posibility.

I think it's not that easy. The HTML viewer will have to be very
flexible to support this kind of stuff. Let's say it just stores in
memory what you are currently viewing, and there is a <b> in the start
of the html document that goes all the way down to the end. How will
the HTML component parse it if that <b> isn't in memory? Since we are
storing pure text, it needs to parse in real-time.

Also in SynEdit the biggest unit I have ever seen is FPCMacOSAll with
100.000 lines, and even there SynEdit works nicely.

The only use I see would be for turning TMemo into a notepad capable
of viewing huge files, but then maybe we should have another component
for this.

My point is: Don't optimize unless you have actually tested and this
is a bottleneck, or else you will probably just make things worse.

About Java use in education what I see most is Java use in my
university in places where it is absolutely not a good choice. Some
example. They made a 3D Game library in Java in a laboratory.
Surprisingly their biggest problem is that its't so slow it's unusable
<g>

Also they were trying to teach us to build a assembler, a relocator
and a linker in Java. Which sane person would do this kind of
low-level tasks in Java? So the operating system needs to relocate a
software in the next 10 milisseconds? Just wait until the virtual
machine starts ...

-- 
Felipe Monteiro de Carvalho



More information about the Lazarus mailing list