You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Grzegorz Kossakowski <gr...@tuffmail.com> on 2007/03/14 14:18:23 UTC

[PROPOSAL] Block conventions

Hi,

I would like to propose some conventions in block's structure. I mean here a structure that matters on sitemap level not
on the lower levels (servlet-fw, packaging, etc.). I think we should advise some guidelines when it comes to the
exposing resources and services to the outside world.

That said I propose to have following URI spaces:
* resource/external/** - resources in this space are meant to be accessible from the outside of Cocoon. It would be
mainly a CSS/JS, etc content.
* resource/internal/** - this resources would be only accessible from other blocks/servlets mounted in Cocoon's
instance. They would mainly consist of XSLT, XML, JX files that one block likes to expose to the others.
* service/** - pipelines in this URI space would be only those which can consume POSTable requests. In short, here would
all block's servlet services services be exposed.

Accordingly, following directory structure would be advised:
<block's context>
  * resource
      * external
      * internal

Also we should reflect this in sitemap created by archetype:
<map:pipeline id="internal-resource" internal-only="true">
  <map:match pattern="resource/internal/**">
    <map:read src="resource/internal/{1}"/>
  </map:match>
</map:pipeline>

<map:pipeline id="external-resource">
  <map:match pattern="resource/external/javascript/**">
    <!-- Usage of this reader guarantees that all possible links in JS are properly handled -->
    <map:read src="resource/external/javascript/{1}" type="servletLinkRewriter">
  </map:match>
  <map:match pattern="resource/external/**">
    <map:read src="resource/external/{1}"/>
  </map:match>
</map:pipeline>

<map:pipeline id="service">
  <!-- put your service pipelines here -->
</map:pipeline>

I think that following "convention over configuration" here is really good idea and most users will take this advice. It
help newcomers to focus on actual work, and it will help block's ecosystem because standardized URI spaces facilitate
block's cooperation.

Comments? Thoughts? Anyone objecting?

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Felix Knecht napisał(a):
>
> > I think that following "convention over configuration" here is
> > really good idea and most users will take this advice. It help
> > newcomers to focus on actual work, and it will help block's
> > ecosystem because standardized URI spaces facilitate block's
> > cooperation.
>
> I don't see such a big benefit. E.g. If a user has an application
> using some forms he still needs to take care in the sitemap which
> matchers shall be exposed externally and which not (think e.g. about a
> multi-page formular and you only want to expose the starting page).
I agree that my proposal does not cover such case you have given as an
example. The point is that it shouldn't. I think that most blocks that
user is going to create will expose some resources and/or services to
the outside world and I think all blocks should do this in similar way.

When you create block's specific functionality (forms, pages) it's
obvious that you have to create block's specific pipelines. I do not
call this into question. My proposal is only skeleton (archetype) for
further tweaking (extending, stripping).
> IMO it will be more confusing (and therefore it may by dangerous)
> having some resources exposed/not exposed by default.The developer
> must decide anyway how the pipeline shall be (internal/external). It's
> not only a design but also a question of security.
Actually, until you put something in resource/external directory nothing
is really exposed. By default you have only provided a directory
structure which can be filled according to your needs. I don't see this
confusing as I cannot think about something more obvious than that
resources under "resource/external"are accessible externally.

To provide an example, I'm refactoring now Ajax and Forms blocks. They
both have some resources that should be exposed to the browser (css and
js files) and they both would be exposing some services. I'm going also
to make as a service samples styling so cocoon-samples-style is going to
expose some css files and actual service. I can give you more examples
if you need...

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Felix Knecht <fe...@otego.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> I think that following "convention over configuration" here is
> really good idea and most users will take this advice. It help
> newcomers to focus on actual work, and it will help block's
> ecosystem because standardized URI spaces facilitate block's
> cooperation.

I don't see such a big benefit. E.g. If a user has an application
using some forms he still needs to take care in the sitemap which
matchers shall be exposed externally and which not (think e.g. about a
multi-page formular and you only want to expose the starting page).

IMO it will be more confusing (and therefore it may by dangerous)
having some resources exposed/not exposed by default.The developer
must decide anyway how the pipeline shall be (internal/external). It's
not only a design but also a question of security.


Felix
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9/og2lZVCB08qHERAlipAKDWeWhrLktrlSKdbWa2fw9LGsbG+QCbB3OB
/AIuPX5kYwEfDfjQWFd2yl8=
=1i3d
-----END PGP SIGNATURE-----


Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Peter Hunsberger napisał(a):
> On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
>
> Almost forgot:
>
>> I remember myself struggling badly on the beginning so I decided that my
>> main aim here (as Cocoon committer) will be making it easier to start
>> with Cocoon for newcomers. I was going to propose many small
>> improvements (at least I see them as improvements) but now I have some
>> doubts if I will have enough energy to struggle like with this one.
>
> Don't let me (or anyone else) scare you. I wade through a high volume
> of e-mail from a lot of lists and may sometimes have to have things
> explained to me more than once .
>
> A little reminiscing:
>
> One of my 1st posts to the Dev list was to respond in favor of a
> change that someone else was proposing and to explain a use case we
> had for the proposed change. It was immediately met by a barrage of
> reasons as to why it shouldn't be implemented by a particular long
> time member (to the point of me being told that he would no longer
> respond to my arguments because I clearly had no idea what I was
> proposing). Two years later or so, the same member ended up needing
> the same change and wrote and committed it himself. Such is life in
> open source development; there are a lot of very different back
> grounds and what is clear to one person often only becomes clear to
> another over a long period of time...
I'm aware of that; my statements you responded to were little emotional 
as I really was feeling resigned and powerless. I'm young and have to 
learn a lot so please be patient.

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Peter Hunsberger <pe...@gmail.com>.
On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:

Almost forgot:

> I remember myself struggling badly on the beginning so I decided that my
> main aim here (as Cocoon committer) will be making it easier to start
> with Cocoon for newcomers. I was going to propose many small
> improvements (at least I see them as improvements) but now I have some
> doubts if I will have enough energy to struggle like with this one.

Don't let me (or anyone else) scare you.  I wade through a high volume
of e-mail from a lot of lists and may sometimes have to have things
explained to me more than once .

A little reminiscing:

One of my 1st posts to the Dev list was to respond in favor of a
change that someone else was proposing and to explain a use case we
had for the proposed change.  It was immediately met by a barrage of
reasons as to why it shouldn't be implemented by a particular long
time member (to the point of me being told that he would no longer
respond to my arguments because I clearly had no idea what I was
proposing).  Two years later or so, the same member ended up needing
the same change and wrote and committed it himself.  Such is life in
open source development; there are a lot of very different back
grounds and what is clear to one person often only becomes clear to
another over a long period of time...

-- 
Peter Hunsberger

Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Peter Hunsberger napisał(a):
> On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
>
> Ok, got it.  From your original e-mail I thought you were proposing to
> have _all_ files placed in the "external" directory available via the
> _same_ sitemap URI. Instead you're saying that you still have to
> access the resources via the servlet: protocol.  In that case, sure, I
> don't see any real problem.  If nothing else at least the project
> supplied blocks will become a little more predictable; though that
> means someone has to go through them all and make them conform to the
> same layout...
I'm glad to see that is clear now and you have no objections. Also, 
lesson taken - in the future I will try to be more precise. What's more 
important, I'm going to state explicitly what knowledge is required in 
order to interpret my statements correctly. ;-)

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Peter Hunsberger <pe...@gmail.com>.
On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
> Peter Hunsberger napisał(a):

<snip/>

> Now, blocks are _completely_ seperated from each other from their
> architecture foundation. It means that resources in one block do not
> interfere with resources in other block in any way. What's more, it's
> virtually not possible to access resources from block A in block B (or
> at least we should not assume that because it's not part of contract
> between blocks) directly. I mean that even if blockA is mounted on
> /root/BlockA and blockB is mounted /root/BlockB we are not allowed to
> access resources from blockA in blockB in this way: map:read
> src="../blockA/foo.js".
> Relative paths are only relative to the block's context. From every
> block's perspective block's context is root path and there is no
> superior location/path whatever.

<snip/>

Ok, got it.  From your original e-mail I thought you were proposing to
have _all_ files placed in the "external" directory available via the
_same_ sitemap URI. Instead you're saying that you still have to
access the resources via the servlet: protocol.  In that case, sure, I
don't see any real problem.  If nothing else at least the project
supplied blocks will become a little more predictable; though that
means someone has to go through them all and make them conform to the
same layout...

-- 
Peter Hunsberger

Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Peter Hunsberger napisał(a):
>
> Small changes have a way of becoming institutionalized; the next thing
> you know two years from know someone will be saying this is the
> proper/only way to do things, or someone will build some kind of
> complex functionality that would be generally useful if only it didn't
> have hard coded built in assumptions...
>

Ok, so let's focus on addressing all doubts.

>> Really nothing...
>> If blockA has external/foo.js and blockB has external/foo.js there is no
>> trouble in such a case. From the blockC perspective, first resource is
>> available under servlet:blockA:/external/foo.js and the second under
>> servlet:blockB:/external/foo.js. This are two absolutely different
>> paths. No option for name clashes...
>
> What's the relative path for each?   What happens if I started out
> with only blockA and had coded dependencies on the relative path for
> it and then later I add blockB (perhaps not even realizing it contains
> a foo.js)?

I'm not sure about what relative path you ask. Could you clarify?

Our discussion on blocks connection and sharing their resources is
little bit out of scope of this particular, small proposal but it's
seems that it's crucial for you so I'm going to address your all doubts
on this matter. :-)
Also, I kindly ask you to take a look at servlet-service-fw samples,
because I suspect that your doubts come from lack of knowledge how this
fw works.
Now, blocks are _completely_ seperated from each other from their
architecture foundation. It means that resources in one block do not
interfere with resources in other block in any way. What's more, it's
virtually not possible to access resources from block A in block B (or
at least we should not assume that because it's not part of contract
between blocks) directly. I mean that even if blockA is mounted on
/root/BlockA and blockB is mounted /root/BlockB we are not allowed to
access resources from blockA in blockB in this way: map:read
src="../blockA/foo.js".
Relative paths are only relative to the block's context. From every
block's perspective block's context is root path and there is no
superior location/path whatever.

Then, how can we access resources from blockA in blockB? We have to make
*connection*. blockB makes connection to the blockA and from this point
blockB is allowed to write something like this:
servlet:blockA:/foo.js. Which means, calculate relative path of foo.js
getting as base path block's context of A. Yes, by writing
servlet:blockA we just change context in which paths are calculated.
When you write just "foo.js" omitting context, current block's context
is used as base path.

This means that you can add files whatever you like to the blockB and
even not thinking of using blockA at the time. Then connect to the
blockA and be sure that nothing wrong happens with filenames because
they are accessible from two different contexts.

I hope that this helps you understand this. If not, I'm giving up and
maybe Daniel can explain it better...

>
>> (I'm really running out of ideas how to explain this)
>
> Maybe I'm missing something about how these both would be made
> available in the site map?

Yes, I think that's the case. And you have explanation above.

>
> That's actually an open question from what I can tell; some people are
> undoubtedly attracted to Cocoon because they think it won't take much
> work to configure or customized but it seems to me that it rarely
> works out that this is true...

Yes, Cocoon now (in 2.1.x) demands lots of configuring, reading the
sources (because documentation is poor), playing with samples etc before
you become productive.
I remember myself struggling badly on the beginning so I decided that my
main aim here (as Cocoon committer) will be making it easier to start
with Cocoon for newcomers. I was going to propose many small
improvements (at least I see them as improvements) but now I have some
doubts if I will have enough energy to struggle like with this one.

Don't get me wrong with my last sentence.

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Peter Hunsberger <pe...@gmail.com>.
On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
> Peter Hunsberger napisał(a):

<snip/>

> What I think is little funny that we discuss so extensively so little,
> small change that is not going to harm anyone experienced with Cocoon...

Small changes have a way of becoming institutionalized; the next thing
you know two years from know someone will be saying this is the
proper/only way to do things, or someone will build some kind of
complex functionality that would be generally useful if only it didn't
have hard coded built in assumptions...

<snip/>

> >
> > Which raises the question; what do you plan to do if two or more
> > blocks have a resource with the same name in their "external"
> > directory?
>
> Really nothing...
> If blockA has external/foo.js and blockB has external/foo.js there is no
> trouble in such a case. From the blockC perspective, first resource is
> available under servlet:blockA:/external/foo.js and the second under
> servlet:blockB:/external/foo.js. This are two absolutely different
> paths. No option for name clashes...

What's the relative path for each?   What happens if I started out
with only blockA and had coded dependencies on the relative path for
it and then later I add blockB (perhaps not even realizing it contains
a foo.js)?

> (I'm really running out of ideas how to explain this)

Maybe I'm missing something about how these both would be made
available in the site map?

> >
> > Sure, and I don't think it's a bad idea.  I'm just not sure it's
> > useful enough to try and define it formally.  No point in defining a
> > convention if no one is going to use it....
> >
> I agree. Most Cocoon developers won't use it, but there are (hopefully)
> folks using Cocoon who are not Cocoon developers/hardcore hackers...

That's actually an open question from what I can tell; some people are
undoubtedly attracted to Cocoon because they think it won't take much
work to configure or customized but it seems to me that it rarely
works out that this is true...

-- 
Peter Hunsberger

Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Peter Hunsberger napisał(a):
>
> The question is whether this convention is generally usable?  For me,
> I can tell you that I would probably not use it, I already have other
> conventions in place for naming and finding resources that I don't
> want to change.  No point in having a convention if it isn't generally
> usable.  Guess I need to hear if other people would find this
> generally usable...

I think that you and me are not good examples of the person for whom
this functionality is going to be useful as we are really experienced
Cocoon-hackers. You have your own convention, I can have my own and we
can live it that happily. I think that you would agree that some
convention is really needed.
What I want to do is to help Cocoon newbies to start actual playing with
Cocoon (instead of reading poor documentation) as quickly as possible.

What I think is little funny that we discuss so extensively so little,
small change that is not going to harm anyone experienced with Cocoon...

> I get all that, and that's the point: you already have to configure
> the block when you create it and you have to know the name of the
> resource at the time you use it.  So for a resource that now falls
> into the general "external" URI name space you still have to know what
> it is named.  What _really_ is the difference whether the user of a
> resource has to specify:
>
>    external/foo.js
>
> or something like:
>
>   servlet:bar:/foo.js

The first one is actually equal to the:
servlet:/external/foo.js
So first path is relative, the second absolute.

>
> If I'm a front end developer I just consider "servlet:bar" part of the
> way I name foo and go on with my business.
>
> Which raises the question; what do you plan to do if two or more
> blocks have a resource with the same name in their "external"
> directory?

Really nothing...
If blockA has external/foo.js and blockB has external/foo.js there is no
trouble in such a case. From the blockC perspective, first resource is
available under servlet:blockA:/external/foo.js and the second under
servlet:blockB:/external/foo.js. This are two absolutely different
paths. No option for name clashes...

(I'm really running out of ideas how to explain this)

>
> Sure, and I don't think it's a bad idea.  I'm just not sure it's
> useful enough to try and define it formally.  No point in defining a
> convention if no one is going to use it....
>
I agree. Most Cocoon developers won't use it, but there are (hopefully)
folks using Cocoon who are not Cocoon developers/hardcore hackers...

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Peter Hunsberger <pe...@gmail.com>.
On 3/14/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
> Peter Hunsberger napisał(a):
> > On 3/14/07, Grzegorz Kossakowski <gr...@tuffmail.com> wrote:
> >>
> >> I think that following "convention over configuration" here is really
> >> good idea and most users will take this advice. It
> >> help newcomers to focus on actual work, and it will help block's
> >> ecosystem because standardized URI spaces facilitate
> >> block's cooperation.
> >>
> >> Comments? Thoughts? Anyone objecting?
> >
> > Almost makes sense at a theoretical level, but I don't think it's
> > practical. Theres ths eimple concerns:  what does someone who is
> > already using Cocoon do when they want to migrate to 2.2 and their
> > existing URI space doesn't match up?  Do we force them to change their
> > URI space?  What if someone is integrating with a CMS or some other
> > system that has other URI requirements?
>
> In both cases nothing bad happens. Their block is just little bit more
> difficult to use from other blocks (that follow conventions) but no more
> difficult than in situation that there is no convention at all. Proposed
> URI spaces are only good practices, you can ignore (and even remove from
> the sitemap) all proposed matchers and do everything the way you like.

The question is whether this convention is generally usable?  For me,
I can tell you that I would probably not use it, I already have other
conventions in place for naming and finding resources that I don't
want to change.  No point in having a convention if it isn't generally
usable.  Guess I need to hear if other people would find this
generally usable...

> > However, more importantly, with blocks you want to have the equivalent
> > of name spaces for the blocks: plug in some component and have it
> > handle the resources in it's URI space without conflicting with the
> > URI space for some other block (eg. two blocks migh each have a
> > "main.js" or some such thing), so for this to work you'd need to
> > either prefix or suffix the URI space for each block with some unique
> > block identifier which sort of defeats the point of doing this in the
> > first place or am I missing something?
>
> Ahh, I think that it's right time for you to have a look on the
> servlet-service framework ;-)
> Block's URIs are already prefixed by servlet-service framework. The prefix is defined in mount-path property, like here:
> [1]. What's really important, block's author should not bother about this prefixes. Take a look at this[2]:
>    dojo.registerModulePath("cocoon.ajax", "servlet:ajax:/resources/ajax/js"); // cocoon.forms has a dependency on the
> cocoon.ajax module libraries
>

<snip/>

I get all that, and that's the point: you already have to configure
the block when you create it and you have to know the name of the
resource at the time you use it.  So for a resource that now falls
into the general "external" URI name space you still have to know what
it is named.  What _really_ is the difference whether the user of a
resource has to specify:

    external/foo.js

or something like:

   servlet:bar:/foo.js

If I'm a front end developer I just consider "servlet:bar" part of the
way I name foo and go on with my business.

Which raises the question; what do you plan to do if two or more
blocks have a resource with the same name in their "external"
directory?

>
> >
> > We may be able to support a default convention, but I think you're
> > going to always need configuration for a URI space...
> >
>
> Maybe I'm repeating myself but I want it to be clear: what I have shown is only proposition of sitemap's skeleton.
> Sitemap where the default pipelines are defined is still yours and you are free can tweak it (by overriding default
> rules e.g.).
>

Sure, and I don't think it's a bad idea.  I'm just not sure it's
useful enough to try and define it formally.  No point in defining a
convention if no one is going to use it....

-- 
Peter Hunsberger

Re: [PROPOSAL] Block conventions

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Peter Hunsberger napisał(a):
> On 3/14/07, Grzegorz Kossakowski <gr...@tuffmail.com> wrote:
>>
>> I think that following "convention over configuration" here is really
>> good idea and most users will take this advice. It
>> help newcomers to focus on actual work, and it will help block's
>> ecosystem because standardized URI spaces facilitate
>> block's cooperation.
>>
>> Comments? Thoughts? Anyone objecting?
>
> Almost makes sense at a theoretical level, but I don't think it's
> practical. Theres ths eimple concerns:  what does someone who is
> already using Cocoon do when they want to migrate to 2.2 and their
> existing URI space doesn't match up?  Do we force them to change their
> URI space?  What if someone is integrating with a CMS or some other
> system that has other URI requirements?

In both cases nothing bad happens. Their block is just little bit more
difficult to use from other blocks (that follow conventions) but no more
difficult than in situation that there is no convention at all. Proposed
URI spaces are only good practices, you can ignore (and even remove from
the sitemap) all proposed matchers and do everything the way you like.

> However, more importantly, with blocks you want to have the equivalent
> of name spaces for the blocks: plug in some component and have it
> handle the resources in it's URI space without conflicting with the
> URI space for some other block (eg. two blocks migh each have a
> "main.js" or some such thing), so for this to work you'd need to
> either prefix or suffix the URI space for each block with some unique
> block identifier which sort of defeats the point of doing this in the
> first place or am I missing something?

Ahh, I think that it's right time for you to have a look on the
servlet-service framework ;-)
Block's URIs are already prefixed by servlet-service framework. The prefix is defined in mount-path property, like here:
[1]. What's really important, block's author should not bother about this prefixes. Take a look at this[2]:
   dojo.registerModulePath("cocoon.ajax", "servlet:ajax:/resources/ajax/js"); // cocoon.forms has a dependency on the
cocoon.ajax module libraries

This javascript fragment comes from Forms block and refers to the ajax block. We do not bother ourselves here about
actual prefix of ajax block (which is 'cocoon-ajax-impl'). For block's writers and users the only important part of URI
is after that prefix. And you have a guarantee (from servlet-service-fw) that if you create some URI under this space
it's going to be Cocoon-wide unique.

I would really suggest to take a look at my work in whiteboard because it shows quite well implementation of most
servlet-service-fw ideas. It's enough to do svn switch, rebuild both blocks and look at samples (under
/blocks-test/cocoon-forms-sample/).

>
> We may be able to support a default convention, but I think you're
> going to always need configuration for a URI space...
>

Maybe I'm repeating myself but I want it to be clear: what I have shown is only proposition of sitemap's skeleton.
Sitemap where the default pipelines are defined is still yours and you are free can tweak it (by overriding default
rules e.g.).

Hope that it helps a little bit.

[1]
http://svn.apache.org/repos/asf/cocoon/whiteboard/ajax-forms-refactoring/cocoon-forms/cocoon-forms-impl/src/main/resources/META-INF/cocoon/spring/cocoon-forms-impl-blockServlet.xml
[2]
http://svn.apache.org/repos/asf/cocoon/whiteboard/ajax-forms-refactoring/cocoon-forms/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/resources/js/manifest.js

-- 
Grzegorz Kossakowski

Re: [PROPOSAL] Block conventions

Posted by Peter Hunsberger <pe...@gmail.com>.
On 3/14/07, Grzegorz Kossakowski <gr...@tuffmail.com> wrote:
>
> I think that following "convention over configuration" here is really good idea and most users will take this advice. It
> help newcomers to focus on actual work, and it will help block's ecosystem because standardized URI spaces facilitate
> block's cooperation.
>
> Comments? Thoughts? Anyone objecting?

Almost makes sense at a theoretical level, but I don't think it's
practical. Theres ths eimple concerns:  what does someone who is
already using Cocoon do when they want to migrate to 2.2 and their
existing URI space doesn't match up?  Do we force them to change their
URI space?  What if someone is integrating with a CMS or some other
system that has other URI requirements?

However, more importantly, with blocks you want to have the equivalent
of name spaces for the blocks: plug in some component and have it
handle the resources in it's URI space without conflicting with the
URI space for some other block (eg. two blocks migh each have a
"main.js" or some such thing), so for this to work you'd need to
either prefix or suffix the URI space for each block with some unique
block identifier which sort of defeats the point of doing this in the
first place or am I missing something?

We may be able to support a default convention, but I think you're
going to always need configuration for a URI space...

-- 
Peter Hunsberger

Re: [PROPOSAL] Block conventions

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Grzegorz Kossakowski skrev:
> Hi,
> 
> I would like to propose some conventions in block's structure. I mean here a structure that matters on sitemap level not
> on the lower levels (servlet-fw, packaging, etc.). I think we should advise some guidelines when it comes to the
> exposing resources and services to the outside world.
> 
> That said I propose to have following URI spaces:
> * resource/external/** - resources in this space are meant to be accessible from the outside of Cocoon. It would be
> mainly a CSS/JS, etc content.
> * resource/internal/** - this resources would be only accessible from other blocks/servlets mounted in Cocoon's
> instance. They would mainly consist of XSLT, XML, JX files that one block likes to expose to the others.
> * service/** - pipelines in this URI space would be only those which can consume POSTable requests. In short, here would
> all block's servlet services services be exposed.
...
> I think that following "convention over configuration" here is really good idea and most users will take this advice. It
> help newcomers to focus on actual work, and it will help block's ecosystem because standardized URI spaces facilitate
> block's cooperation.
> 
> Comments? Thoughts? Anyone objecting?

Seems like a good idea.

/Daniel