bricks-devel Mailing List for bricks
Status: Beta
Brought to you by:
petermcd
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Peter M. <ilu...@ho...> - 2001-07-23 23:02:58
|
<html><div style='background-color:'><DIV>
<P>Hope the code wasn't too difficult to get through.<BR><BR>>From "P.Fleury" <FL...@US...></P></DIV>
<DIV></DIV>>To: pe...@pm...
<DIV></DIV>>Subject: Got the idea... roughly;-)
<DIV></DIV>>Date: Mon, 23 Jul 2001 11:13:25 +0900
<DIV></DIV>>
<DIV></DIV>>Hi again !
<DIV></DIV>>
<DIV></DIV>>This week-end (which was a 3 days week-end here in Japan) I went
<DIV></DIV>>through
<DIV></DIV>>the code of Bricks. I think I have a good idea of what is in there
<DIV></DIV>>now,
<DIV></DIV>>and I also finally got what you use redirect/mappings etc. for. All
<DIV></DIV>>this raised some fundamental questions, for which I could not
<DIV></DIV>>reverse
<DIV></DIV>>engineer your sequence of thoughts when designing this.
<DIV></DIV>>
<DIV></DIV>>1) You deal with encapsulating Mason components, using the
<DIV></DIV>>Apache->request directly, need some caching, etc. Why isn't the
<DIV></DIV>>Brick.pm
<DIV></DIV>>a Mason component in the first place ? Then, you would not have to
<DIV></DIV>>care
<DIV></DIV>>about caching, you could use Mason's request object (which can be a
<DIV></DIV>>hand
<DIV></DIV>>crafted if run from a script, which I do have :-).
<DIV></DIV>
<P> </P>
<P>One reason is that I would like to be able to write "pure perl" bricks. For example, column, which is by far the most commonly used brick, could be rewritten as just a perl class. My hope is that pages will render faster under pure perl rather than mason + perl. I'm not certain that this will happen, but Bricks did get significanltly faster when I moved the 'core' code, what's now in the .pms, from Mason to Perl.</P>
<P>The downside is that you can't use some of Mason's features. Virtual hosting would probably also be easier with pure Mason. Also, I prefer the $rbrick->method_name(...) call mechanism to $m->comp('brick_name:method_name',...) mechanism.</P>
<P> </P>
<DIV></DIV>>2) Extending/writing new Bricks seems to place a lot of the burden
<DIV></DIV>>to
<DIV></DIV>>the Bricks writer. Doing thing recursive is neat programming, but
<DIV></DIV>>then
<DIV></DIV>>each object has to deal with things like parsing the tree of bricks,
<DIV></DIV>>routing calls, walking, etc. I would see like 2 types of Bricks:
<DIV></DIV>>structure bricks ( column, assembly, table, etc.) for which this
<DIV></DIV>>complexity is needed, and simpler bricks (provided ones like Text,
<DIV></DIV>>Image, etc.) and a wrapper brick which needs the new Brick creator
<DIV></DIV>>write
<DIV></DIV>>only the absolutely necessary portion of the code. (This complexity
<DIV></DIV>>hiding would most probably trigger more Bricks being written. Then
<DIV></DIV>>people get used to it, can broaden their knowledge of the system,
<DIV></DIV>>and
<DIV></DIV>>write more comple ones :-)
<DIV></DIV>
<P>> </P>
<P>It should currently work just as you would like it to. There are two classes of bricks: containers such as column, table, and assembly, and there are leaf-nodes, such as text, photoalbum, etc.. The user should only have to implement a method such as route_sub or walk on bricks that are containers.</P>
<P>In fact, a user doesn't have to implement any method other than render for a brick to work.</P>
<P> </P>
<DIV></DIV>>3) Also the bricks have to render themselves in edit mode as well as
<DIV></DIV>>in
<DIV></DIV>>normal mode. Whereas I think this is ok for complex bricks (table)
<DIV></DIV>>which
<DIV></DIV>>also need some specific rendering for easier editing (e.g. the
<DIV></DIV>>split/join icons). I we want to add something like a frame around
<DIV></DIV>>each
<DIV></DIV>>brick in edit mode, and have a title bar with a few icons in there,
<DIV></DIV>>representing actions like "add element", "remove brick", "edit brick
<DIV></DIV>>properties", then we will have to modify each of them... This
<DIV></DIV>>coupling
<DIV></DIV>>is not good in the long run I think.
<DIV></DIV>
<P> </P>
<P>Actually, the 'tabs' that have the brick name, the brick number, and draw the box are drawn by column before it calls render() on the brick. You might be thinking of the render_edit method? This is used to render the brick properties. For example, with the text brick when you want to edit the text inside the brick, the html form is rendered with render_edit and a redirect.</P>
<P> </P>
<P> </P>
<DIV></DIV>>This all looks like huge work, I know :-) So that is why I would
<DIV></DIV>>like to
<DIV></DIV>>know if there are issues you have foreseen that I just do not see.
<DIV></DIV>>
<DIV></DIV>>However, there are a few things which I found very interesting in
<DIV></DIV>>the
<DIV></DIV>>way you tackle the problem:
<DIV></DIV>>- your way of defining arguments for bricks, and the way you route
<DIV></DIV>>them,
<DIV></DIV>>- bricks with a set of methods, which actually defines Bricks as
<DIV></DIV>>bricks
<DIV></DIV>>the way Java defines Beans, by adhering to API conventions only.
<DIV></DIV>>- the freeze/thaw mechanism, which I think could be reused for
<DIV></DIV>>store/save and backup/restore.
<DIV></DIV>>- the way one can handle tables within a browser, that's killer :-)
<DIV></DIV>
<P>> </P>
<P> </P>
<P>I haven't played with Java Beans, but yes, I think that freeze/thaw could be used for the backup/restore function. I just think it should be modified a little to facilitate off-line editing.</P>
<P> </P>
<P>You like the table stuff, eh? Are you familiar with cascading style sheets? It looks to me like people on the web are working to replace tables as a layout tool with cascading style sheets. It's something else that needs to be looked at.</P>
<DIV></DIV>>I will probably try to write down the global design of Bricks in
<DIV></DIV>>some
<DIV></DIV>>form. Writing this kind of documentation helps me understand things,
<DIV></DIV>>and
<DIV></DIV>>leaves a nice document around...
<DIV></DIV>
<P>> </P>
<P>Sounds good. </P>
<P> </P>
<P>-Peter</P></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|
|
From: Peter M. <pe...@pm...> - 2001-07-19 21:00:23
|
Pascal Fleury asked me to type up my ideas on where I see Bricks Site Builder heading. The following is a rough outline, completely subject to change, of what I think Bricks Site Builder could someday do. I have no intention of writing all this stuff myself, or asking others to write it. But, if you're looking for something cool to do, you might find it below. -Peter core: user administration (with hooks to add address books and other data to a user acct) system configuration (control panel) internationalization/localization (i18n/l8n) staging/release packing/unpacking part of a site for off-line editing, or as a partial backup backup/restore - like pack/unpack but for whole site. output caching (speed, speed, speed!) file-locking so that multiple people can simultaneously edit scalability logging and log analysis search engine w3 accessibility initiative (for handicapped people). slick java application that turns a users web-browser into a page editor. Here are a list of packages (packages might contain a number of bricks as well as external software) that would be based around the idea of providing a portal that users can customize: webfolders: webfolders so users can upload/download files cvs backup manager for webfolders personalpages: allows users to interactively edit parts of the site on their own weblogs, photoablums go here styles, pre-built pages that can be customized bricks from other packages could be installed into user pages (e.g. infoslurp/webmail) infoslurp: moreover.com discussion forum integration factiva newsedge stock quotes/markets news web-crawler to search daily/hourly/weekly for certain information site monitor (when was such-and-such site last updated) integration into a mapping database (maps.yahoo.com) shopping slurper (go to a bunch of sites and find me prices for a given good) webmail: web-based e-mail client (hotmail, yahoo-mail, etc.) pop-mail support so users can access accts on other systems address book integration ability to export e-mail messages to a file Moving away from a user portal to providing services: webpublish: article submit -> staff editor for review -> publish mechanism discussion forums banner ad support hooks to plastic computer-aided instruction (CAI): Should give teachers the ability to provide courses over the web. Testing and evaluation, where wrong answers potentially tell students to reread such-and-such a chapter ot take those students to an on-line lesson. Something flexible, something cool. e-commerce: storefront auctions ability to sell bottled cat spit lots and lots of other e-commerce related stuff here biztools: calendars scheduling address book integration problem tracking project tracking bug reporting (service requests) expense reports sales orders service orders recruiting / on-line resumes web-games: web Galactic Conquest card games star trader misc: polls of user (what's your favorite stinky vegetable?) message boards chat X10 controllers (press this button to turn off the lights in your house) |