Archive for the ‘Ideas’ Category

Conditionals in CDS (or stitch)

November 2, 2005

Trying to decide on a way of doing conditionals in the cds stuff…my options so far are:

#favorite_song{
ctrl-content:ctrl.equals($user.name, “Joe”) “Some Song”;
ctrl-content:ctrl.equals($user.name, “Alice”) “The Muppet Song”;
ctrl-content:ctrl.equals($user.name, “Corbin”) “Blue’s Clues”;
ctrl-content:lang.i18n(”unknown_song”);
}

/* OR */

#favorite_song{
ctrl-content-0:ctrl.equals($user.name, “Joe”) “Some Song”;
ctrl-content-1:ctrl.equals($user.name, “Alice”) “The Muppet Song”;
ctrl-content-2:ctrl.equals($user.name, “Corbin”) “Blue’s Clues”;
ctrl-content-3:lang.i18n(”unknown_song”);
}

/* OR */

#favorite_song:ctrl.empty($user.name){
lang-textContentKey:”unknown_song”;
}

#favorite_song:ctrl.equals($user.name, “Joe”){
ctrl-content: “Some Song”;
}

#favorite_song:ctrl.equals($user.name, “Alice”){
ctrl-content:”The Muppet Song”;
}

#favorite_song:ctrl.equals($user.name, “Corbin”){
ctrl-content:”Blue’s Clues”;
}

Ideas…CDS

November 1, 2005

%def-tags%{
ctrl:com.ctrlweb.cds.DefaultProcessor;
lang:com.ctrlweb.cds.LangProcessor;
}
%def-inputs%{
title:string;
records:collection required;
time:date required “MM/dd/yyyy HH:mm:ss”
page:TemplatePage;
}

title{
ctrl-content:page.head.title;
}

#content{
ctrl-content:page.body;
}

label{
lang-text-content-key:$(document[this[@for]][@name]);
lang-text-content-default:”####”;
}

#records{
ctrl-iterate-collection:records;
ctrl-iterate-var:record;
ctrl-iterate-copynode:#records .record;
}

#records .record .album{
ctrl-content:record.album;
}
#records .record .artist{
ctrl-content:record.artist;
}
#records .record .year{
ctrl-content:record.year;
}

JSTable cram session

September 5, 2005

I’m putting together a kind of JavaScript TableModel object to facilitate some things on a project at work. So, this is my cram session for it. You can see the ideas change and clarify as it goes.


TableModel is the data.
TableView binds to and inspects the TableModel to determine how/what to display
BeanBackedTableModel has a data object that serves as the backing for the actual cell data in the table.
However, TableModel is PRIMARILY the model for the actual TABLE. So, it holds the state for the TABLE entity. The fact that part of that state may come from an underlying data object is secondary.
TableView must be able to (potentially given the type of TableModel) reconstruct the model only from the (potentially very basic) view representation. So, for example, on an initial page load if there is data in the table by default, that data should be extracted/scraped from the view to initialize/construct the inital model. This feature may also be implemented as an entirely separate object…a TableModelInitializer perhaps.
In the latter case, the TableView that eventually is bound to the same table must be made aware of the inital state (this is why it may make sense for the 2 things to be on the same object.

So, ‘what state does a table have’:
columns
rows
header
footer
caption
summary

(future) support RTL directionality

Stab at a Requirements List:
1. Table Structure CAN still be defined by the markup.
2. Table Sturcture CAN be entirely JS-built
3. JS Table Model can be reconstructed from the markup.
4. JS Table Model (data) can be backed by a JS Domain Object or collection of them.
5. Can add Domain objects directly to the table.
6. Can edit (optionally) the table model (data) directly in the table.
7. Can sort the table model (data).
8. Developper can take an existing static table and easily behavior-ify it (add sortability and even in-line updating) in a declarative fashion.
9. Can handle/do paging
10. Can do static header/scrollable data section.
11. Can break columns into sections.
12. Can have static columns.
13. Support a kind of extension model. new features can be attached to the table model (like drag-n-drop column arrangement, show/hide columns, etc).
14. Completely/easily css styled.
15. Data Model should be easily extracted from table (for ajax update/insert
purposes). Consider ability to distinguish/notify of: rowupdated, deleted, added.
16. Ability to select/deselect rows (be careful with pager integration as well as pager integration with the sort capability). Does this imply a difference between the full data model and the displayed dom model? The pager very much just controls what rows are displayed…it could be made aware of changes to the actual underlying data model. Would sort-order actually modify the data model? or would that too merely be a display thing. So the actualy model is always in initial and insertion order…then the sort ‘module/extension’ keeps the actual sorted model (or index) off to one side and modifies the actual dom as sort requests come in. Well, we have 2 models really…the actual TableModel and the DataModel that backs it. The DataModel could be always kept in insertion order, and the TableModel (SortableTableModel?) could be aware of the order and return the rows in the appropriate order. Then have a nother model for the pager (PageableTableModel?) for the page-ability. Then the models would have to be stackable (decoratable). So you could have a sortable table model that is wrapped by a pagabletablemodel. the getRows function would first be processed by the sortable and it would return the rows in sorted order then the pager would break it up (post-sort) and page accordingly. The select-all feature would have to get the list of rows from the table model and then select all of the ones returned. I suppose some caching could take place or some other optimization (for example, the model could have some sort of modified event that could fire and the wrapping instance could listen for that event and invalidate its current state (or what was returned by the wrapped model). otherwise assume the rows are the same (at least according to the wrapped instance) and the old ones can still be trusted and returned.

So, for a base TableModel we need what?
1. getRows
2. getColumns
3. getDataModel
4. getHeader (allows changes in th and others…for things like dnd columns).
5. getFooter

The Rows are an array of the actual TR objects that should appear in the data (tbody) section(s) of the table. (for now only one tbody section is supported…should be able to refactor later to support getRowGroups and getColGroups instead…).

DataModel always holds all of the data for the table (even data for cols and rows not displayed) in insertion order. It will always be an array. The array may contain: arrays, hashes, or objects. The default data model will simply be a 2d array of strings. When modifying a table (adding/removing rows) the DataModel is what is manipulated. When modified it will fire a modified event…the table model will be nofitied of it and will modify its rows collection and fire a modified event of its own with the new DOMRow as a property on the event (which will travel up the chain to the JSTable object, potentially being further modified/behavior-ified along the way). The JSTable will then decide it is time to update the view (depending on the type of event (added/removed/updated) and will affect the change to the underlying dom table.

Ok…good for an up-front design/cram session. Now go do some TFD keeping this in mind as something to work toward.

Google Portal

June 1, 2005

Just tried out googles portal. MAN! I know its just a portal, but it really feels more like the web-based konfabulator idea I’m tinkering with…maybe because of the drag-n-drop (which is pretty cool). I think what really drives it in that direction is the driving directions ‘portlet’ (ok…that was weird).

The CSS Framework

May 26, 2005

This is good. I’m almost certain it is what most web-app teams work toward. From app to app, its good to have a set standard for your overall page layouts. I wonder if this will kind of kick off a defacto standard for basic building-block classes and ids for sites and apps? Just a basic set of common ones. I think that could be useful…may even make the idea of the ‘use my own stylesheet’ option in browsers actually interesting.
Content with Style: A CSS Framework

So, I think its a great start, but I also think think it can be extended for web-apps to include classes for common widgets like date-pickers.

OSS Bounties

May 11, 2005

There is an article on slashdot about OSS Bounties. It got me thinking…and not directly about what the article/comments were talking about. I really saw it as a neat idea/addition to an existing feature request and donation system.

If your project already takes donations and has feature requests, you could just ask (as part of donation) which feature the donator is interested in (have a ‘no particular feature option too). Then, on your feature request page, provide an additional ‘donate’ link on each feature. There would really be no expectation of “If I pay for it…it should be implemented”. It would just be a way for the users to suggesting direction for the project while donating.

Will this bring a lot more money to an OSS Project, doubtful. I still like the idea.

This also made me think of the Programming Language stock trading game (btw…took me forever to track that down again…tons of google/slashdot/bloglines searches…google finally won with a search for: programming language market…first result found). It would be interesting to do something similar for OSS…I dunno what the payoff would be…just a fun way to see where your donations are going and seeing where other oss projects are.

Bits of me in one place

May 9, 2005

A couple discussions have been going on over at photomatt’s blog. I’ve also been playing a bit with backpack and basecamp. All these things have banded together to really pique my interest and thinking for ways to use blogs and feeds in different ways.

Imagine your blog being super-smart. You make a post that contains a date and it will extract the date and some information from the post and ‘ping’ a calendar service to create an event for you. Or you make a list of things, and it will extract the list and add them to a tada list for you (maybe prompt you first). Or, better yet, you have your services ’subscribe’ to your blog…the services will periodically extract things from the blog instead of (or in addition to…both could co-exist) your blog feeding the services.

Now what if you are a developer…working on some projects. You can just post to your blog like normal and (depending on the category perhaps), your posts will get pulled into your software management site (todo lists/meeting dates/bug replies/etc). When you join another project, you just enter your blog address (and category perhaps) in the software management agregator and off you go.

Your blog could be like a free-form database and source feed into several of the systems you use elsewhere. Imagine flickr pulling photos from your blog instead of you posting them to your blog and flickr.

Then, instead of bits of me spread all over these different systems…it is in one place, but accessible by all of those systems.

Java Solution Needed

May 6, 2005

Spring just got a new look. I don’t really like it (not the point, but thought I’d throw it out there). I do appreciate the need to move to a CMS…or should I say AMS (Article Management Site…I feel a lot of tools mis-label themselves CMS). When I read that they were using Drupal, I reeled. Not because I don’t like drupal…its OK (I settled on PhpWebsite for the community site I do…it was just fit better for me…but I’m sure drupal has a larger developer community and it is certainly prettier). I reeled because the springframework guys…guys I respect for great java code/ideas/contribution, have settled on a PHP-based tool for their website/cms tool.

This isn’t new in the java world…I’ve heard similar gripes about many other java sites. Why does this happen? A short list of reasons:

  1. Java Hosting is more expensive
  2. There are already good php and perl solutions in this space
  3. There isn’t a good, open-source java cms out there (nukes on jboss is pretty much the only one I know of)

Argument #1 is becoming less and less an issue (compared to what it used to be anyway)…but it still isn’t low enough for the average-joe tinkerpage. However, I think it is reasonable for a significant community site or Open Source project.

Then again, if you have something people want…but its java…people will probably look for (or write!) a php/perl solution for it first…just because it is still far cheaper to host php/perl apps. Which leads into Argument #2. My only answer for this is that we’ve seen what php and perl have done in this space…now lets see what open source java can do. We may wind up with a tool that is slick enough to warrant paying the higher hosting prices (which in turn would lower the hosting prices because of increased popularity/familiarity/competition). Ultimately leading to a boom in java-based solutions for average web pages (sounds ridiculous…but could happen…eventually).

Finally argument #3…kind of because of the previous arguments…there are not many java solutions in this space. The only one I know of is nukes for jboss…and I pretty much hate php-nuke. Even in the php world, there are many better solutions (like drupal and phpwebsite) I would never have made any kind of decision to mimic that system in java. This DOES need to be remedied.

We need a java-based solution to emerge on to the scene…if only to make me feel better.

Update: Found a few here. Guess I just haven’t looked very hard ;) From what I’ve read (generically) none of them compare with the ease of use that the php ones have evolved into…I’ll have to look into that.

Scraps: Thinking Out Loud

April 25, 2005

Tinkering with some ideas/thoughts on the shadow-like system I want to put together…here is what I had jotted down in a text doc:

Core - very simple (spring bean factory-like)
Modules - Totally Pluggable. Self-Installing/Uninstalling/Updating.
- plugin 3rd party (wordpress) modules (and hence the services
provided by them…as well as 3rd party
core-like modules (persistence? security).
Module categories?
No programming language requirement for modules?
Services (modules can publish services)
Event Pub/Sub - can subscribe to an recieve messages
Simple to configure/layout/understand
Support for workflows
Portal features
View Template features
View Theme features
Versioning Features/system
Ease of Module interaction
i18n
Scale up/down
pluggable security w/declarative and programmatic support
Self-Documenting (meta?)
Good Defaults (runs out of box).
Web-Based installer (wizard-like) runs on simple core with simple web install module
Stand-Alone installer (with own internal web server)
Easy to test (test-harness module?)

Extreme Focus on Core for R1
- IoC Container
- configured via properties files or xml files
- module manager
- install/update/remove/query modules

Install:
d/l zip (tar.gz)
unpack
modify install.config (db info)
open browser to /install
(at this point, the config has been verified/validated and the module manager has
been installed & self-updated)
choose install mode (minimal, bundled, custom, all) & whether new versions
should be installed if found
(if bundled) ask for purpose of site (blog, community portal, ecommerce)
(if custom)choose modules to install (possibly also have indicators for which
modules are part of which bundles)
For modules to be installed, choose defaults/manual config options for each/all
configure modules (if chosen to).

On Versioning.
Modules are versioned. At the point a module is being upgraded, the resident
data for the module will be modified (if necessary) to conform to changes required
in the version.
Data may or may not be versioned as well (module and data specific).
Data associated with a module (whether or not the data itself is
versioned) should know what version of the module its current state is set for
(column in table? flag exported data? point of export.)
Modules can express dependencies on other modules including version (”after”,
“before”, “only”).
Modules can indicate they provide a common service and the version of the
service that they adhere to and the completeness of the implementation
(what operations are/are not supported).

can versioning be totally aop-like?

create module (document maker)
defines tables (w/o version stuff)
installs module.
enables versioning for the module
tables are modified (renamed & version columns created & then views?) to have
version info. Modules should provide a dao to ‘blindly’ map from a rs (or map)
to the value object (or subclasses thereof)…or just provide it in a mapping
(like ibatis?):

name = DOC_NAME
desc = DOC_DESC

Should versioning support need to be coded into the modules…maybe.
modules would have a versioning config of some sort to indicate what
operations support versioning.

Would be nice if other interfaces could interact with system (e.g. a
remote swing admin console)…perhaps just via exposing some services
and method over web service. brings up some security questions.

Indexing/Search as a core feature
- modules should provide a mechanism for accessing the data that they
store (for external indexing)…along with a mechanism by which that
data can be re-accessed.

Spring Intro

April 25, 2005

I’m planning on giving a couple of presentations on the Spring Framework to a group of consultants. I’ll probably be posting my “notes” (outline, etc) for them here. My first will just be an intro to spring…along the lines of the following rough outline:

  • What is Spring Helping to Solve (problems)
  • Inversion of Control & Dependency Injection
  • Lightweight Container
  • Application Context
  • Integration with other Tools/Frameworks (Hibernate, Struts, EJB)
  • Standalone utilities (jdbc abstraction framework, etc)
  • AOP
  • Spring MVC
  • Declarative Transaction Management

Lots of stuff to hit…but it will be fairly brief on each piece. It should be followed by more advanced presentations that will dig deeper into the details. I may even walk-through Spring’s Petstore…kind of a ‘putting it all together’ presentation.

I should probably read Pro Spring before giving the talks though…just so I don’t miss something.