I'm reading "Design Patterns: Elements of Reusable OOSW". In chapter two, the authors provide a case study of an editor they refer to as Lexi, which seems to be written in C++. I've looked around everywhere, but the only useful link I could find said this:
The 开发者_如何学编程Gof tell us in a note that Lexi is based on "Doc, a text editing application developed by Calder". But this paper only outlines an editor, without any source. And I even believe today that Lexi never truly existed as a program.
The link provides Delphi source. I'm after C++, cause that's what I'm comfortable with, and that's what's used in the book.
Does anybody know where I can find C++ source for Lexi? If the original never existed, it would be good to find something that I can use as a base. I really don't feel like writing my own text editor from scratch just so I can work through the case study in this book.
Doc was developed using the InterViews UI toolkit. I believe that doc source is part of the InterViews distribution. Doc was used to typeset Paul's thesis. (Paul Calder was my lecturer at Flinders University)
If you look at the InterViews code you might be surprised. It was developed before modern C++ existed. For example, there are no templates. And there are no comments in the code.
To my understanding, Lexi never existed. It was created as an example for the book by GoF.
Maybe a Java implementation can help, being it more similar to c++. Here it is: jexieditor - A WYSIWYG editor based on JavaSE. I have not had a look at the code yet, anyway
I may be showing my age here but are you sure about C++? I have a funny feeling that when that book came out originally it may have been oriented toward Smalltalk. Its just something nagging at the back of my mind, I can't substantiate it I'm afraid
I'm currently implementing Lexi analog, pls take a look https://github.com/romaonishuk/LexI. Implementation is still in progress, but most of the described in GoF patterns and concepts are implemented using C++.
This is the code source of LEXI, written in Delphi unfortunately for you: LEXI sources.
It appears that the source code might be on the CD-ROM version of Design Patterns that came out in 1998. According to the Amazon listing, the CD contains (among other things):
Sample code demonstrating pattern implementation
Furthermore,
All patterns are compiled from real-world examples and include code that demonstrates how they may be implemented in object-oriented programming languages such as C++ and Smalltalk. Readers who already own the book will want the CD to take advantage of its dynamic search mechanism and ready-to-install patterns.
Whether these code samples include the full Lexi source is impossible to tell from the listing, and the current price of the CD (£86.87) is rather high. But it might be worth checking if any local libraries have the CD in stock.
I was just trying to find out if a real working Lexi version exists, to have a concrete reference, but I didn't find it. I found this Java version on GitHub: https://github.com/AmitDutta/lexi I don't know, maybe it could be useful for someone's purpose here.
精彩评论