On Wed, Mar 18, 2009 at 7:31 AM, Georg Ragaller <[email protected]> wrote:
> I think the inconsistency stems from the fact, that the codebase is still in
> a state of flux (which is good at this time) and that the code snippets used
> as example code are not tied to the codebase (which is not so good). The
> glue between the codebase and the sample snippets is manual work. And that
> gets easily forgotten when performing a refactoring.
When possible, I have tried to tie the actual code from samples or
tutorial codebase, and as you have realized it makes the samples too
large in most cases and noise obscures the actual benefit.
> 5. reference code snippets from the (current) codebase in the samples =>
> samples are always compileable; with appropriate testcases, chances are high
> that the code will even run most of the time; sample code is refactoring
> safe
> public class Sample
> {
> // $$Snippet(main)$$
> public static void main( String[] args )
> {
> for( String string : args )
> {
> System.out.println();
> }
> }
> // $$Snippet$$
> }
> One could wrap this functionality with a servlet (or e.g. a SiteVison-Plugin
> or whatever is possible), to create the notion of a snippet-url like e.g.
This sounds like an excellent idea. Especially if one could support;
ObjectBuilder</* $$Html( "<b>") */Person/*$$Html("</b>") */> builder = ...;
And Sitevision is very capable when it comes to "Retrieve a Resource"
and sticking that into a page, so making a servlet to be mounted
sounds like straightforward.
Cheers
Niclas
--
http://www.qi4j.org - New Energy for Java
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev