You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Rex Wang <rw...@gmail.com> on 2009/06/23 15:06:48 UTC

Build the GBeanInfo with the attribute name caselessly?

Build the GBeanInfo with the attribute name caselessly?

Currently, we build the GBeanInfo attribute according to the java code
convention. However, we user set the attribute throught the plan, he have to
pay attention to the case of the attribute name, such as:
        <gbean name="SMTPTransport">
            <attribute name="host">${SMTPHost}</attribute>
            <attribute name="port">${SMTPPort}</attribute>
        </gbean>
and
        <gbean
name="org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car,j2eeType=GBean,name=uniquename2"
load="false"
gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
            <attribute name="keepAliveTimeout">60000</attribute>
            <attribute name="maxThreads">40</attribute>
            <attribute name="acceptCount">10</attribute>
            <attribute name="connectionTimeout">60000</attribute>
            <attribute name="connectionLinger">-1</attribute>
            <attribute name="address">0.0.0.0</attribute>

but we it comes to the ra.xml, we always use the first upper case word to
define the properties, such as:
        <config-property-name>DatabaseName</config-property-name>
        <config-property-type>java.lang.String</config-property-type>
and that causes the program logic in the config module builder should deal
with that specificly...programmer might hate that..

So, if either the user or developer will get un-happyness on this
configuration, why not we build the GBeanInfo with a caseless name
indentifid GAttributeInfo?

-Rex
Jun 23

Re: Build the GBeanInfo with the attribute name caselessly?

Posted by Jack Cai <gr...@gmail.com>.
Looks like a good idea to me.

-Jack

On Tue, Jun 23, 2009 at 9:06 PM, Rex Wang <rw...@gmail.com> wrote:

> Build the GBeanInfo with the attribute name caselessly?
>
> Currently, we build the GBeanInfo attribute according to the java code
> convention. However, we user set the attribute throught the plan, he have to
> pay attention to the case of the attribute name, such as:
>         <gbean name="SMTPTransport">
>             <attribute name="host">${SMTPHost}</attribute>
>             <attribute name="port">${SMTPPort}</attribute>
>         </gbean>
> and
>         <gbean
> name="org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car,j2eeType=GBean,name=uniquename2"
> load="false"
> gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
>             <attribute name="keepAliveTimeout">60000</attribute>
>             <attribute name="maxThreads">40</attribute>
>             <attribute name="acceptCount">10</attribute>
>             <attribute name="connectionTimeout">60000</attribute>
>             <attribute name="connectionLinger">-1</attribute>
>             <attribute name="address">0.0.0.0</attribute>
>
> but we it comes to the ra.xml, we always use the first upper case word to
> define the properties, such as:
>         <config-property-name>DatabaseName</config-property-name>
>         <config-property-type>java.lang.String</config-property-type>
> and that causes the program logic in the config module builder should deal
> with that specificly...programmer might hate that..
>
> So, if either the user or developer will get un-happyness on this
> configuration, why not we build the GBeanInfo with a caseless name
> indentifid GAttributeInfo?
>
> -Rex
> Jun 23
>

Re: Build the GBeanInfo with the attribute name caselessly?

Posted by Rex Wang <rw...@gmail.com>.
Underneath the geronimo-connector-builder, a couple of codes  in the
ConnectorModuleBuilder.java like this:

if (attributeInfo == null) {
                String originalName = name;
                name = switchCase(name);
                attributeInfo = gbeanData.getGBeanInfo().getAttribute(name);
                if (attributeInfo == null) {
                    unknownNames.add(originalName);
                    continue;
                }
            }

that is caused by some of the properties in the rar plan always prefer the
Upper case word as the name, such as
                    <config-property-setting name="Password"/>
                    <config-property-setting name="LoginTimeout"/>
                    <config-property-setting
name="DatabaseName">SystemDatabase</config-property-setting>
                    <config-property-setting name="UserName"/>
A jira is opened for that in the past(G-4131).


I think there might be a little bit difference with the blueprint, our plan
file is more like used by a user to config a application, but the purpose of
blueprint which grasp the sprit of spring framework is to provide a
convienent way for application developer to assemble javabeans to some
extent, isn't it?


-Rex



2009/6/24 David Jencks <da...@yahoo.com>

> Perhaps I can be convinced otherwise but I think the attribute and
> reference names should remain case sensitive.  Are there other DI systems
> that have case insensitive property names?  What does blueprint do?
>
> I don't like case insensitive file systems either :-)
>
> I'm not exactly sure what connector code you are thinking of, can you point
> to it more specifically?
>
> thanks
> david jencks
>
>
> On Jun 23, 2009, at 6:06 AM, Rex Wang wrote:
>
>  Build the GBeanInfo with the attribute name caselessly?
>>
>> Currently, we build the GBeanInfo attribute according to the java code
>> convention. However, we user set the attribute throught the plan, he have to
>> pay attention to the case of the attribute name, such as:
>>        <gbean name="SMTPTransport">
>>            <attribute name="host">${SMTPHost}</attribute>
>>            <attribute name="port">${SMTPPort}</attribute>
>>        </gbean>
>> and
>>        <gbean
>> name="org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car,j2eeType=GBean,name=uniquename2"
>> load="false"
>> gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
>>            <attribute name="keepAliveTimeout">60000</attribute>
>>            <attribute name="maxThreads">40</attribute>
>>            <attribute name="acceptCount">10</attribute>
>>            <attribute name="connectionTimeout">60000</attribute>
>>            <attribute name="connectionLinger">-1</attribute>
>>            <attribute name="address">0.0.0.0</attribute>
>>
>> but we it comes to the ra.xml, we always use the first upper case word to
>> define the properties, such as:
>>        <config-property-name>DatabaseName</config-property-name>
>>        <config-property-type>java.lang.String</config-property-type>
>> and that causes the program logic in the config module builder should deal
>> with that specificly...programmer might hate that..
>>
>> So, if either the user or developer will get un-happyness on this
>> configuration, why not we build the GBeanInfo with a caseless name
>> indentifid GAttributeInfo?
>>
>> -Rex
>> Jun 23
>>
>

Re: Build the GBeanInfo with the attribute name caselessly?

Posted by Rex Wang <rw...@gmail.com>.
Yes, that is what we did in the connector module builder specificly. I mean
since both the "thisProperty" and "ThisProperty" have been supported in the
builder code, why not support it in the gbeaninfo level? :)

-Rex




2009/6/24 Rick McGuire <ri...@gmail.com>

> David Jencks wrote:
>
>> Perhaps I can be convinced otherwise but I think the attribute and
>> reference names should remain case sensitive.  Are there other DI systems
>> that have case insensitive property names?  What does blueprint do?
>>
>
> Blueprint is case sensitive for property names, using the JavaBeans
> convention.  However, because of how case gets folded when looking for the
> setter, "thisProperty" and "ThisProperty" would both work....not totally
> casesensitive, just an artifact of the rules used for constructing the
> method name.
>
> Rick
>
>
>> I don't like case insensitive file systems either :-)
>>
>> I'm not exactly sure what connector code you are thinking of, can you
>> point to it more specifically?
>>
>> thanks
>> david jencks
>>
>> On Jun 23, 2009, at 6:06 AM, Rex Wang wrote:
>>
>>  Build the GBeanInfo with the attribute name caselessly?
>>>
>>> Currently, we build the GBeanInfo attribute according to the java code
>>> convention. However, we user set the attribute throught the plan, he have to
>>> pay attention to the case of the attribute name, such as:
>>>        <gbean name="SMTPTransport">
>>>            <attribute name="host">${SMTPHost}</attribute>
>>>            <attribute name="port">${SMTPPort}</attribute>
>>>        </gbean>
>>> and
>>>        <gbean
>>> name="org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car,j2eeType=GBean,name=uniquename2"
>>> load="false"
>>> gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
>>>            <attribute name="keepAliveTimeout">60000</attribute>
>>>            <attribute name="maxThreads">40</attribute>
>>>            <attribute name="acceptCount">10</attribute>
>>>            <attribute name="connectionTimeout">60000</attribute>
>>>            <attribute name="connectionLinger">-1</attribute>
>>>            <attribute name="address">0.0.0.0</attribute>
>>>
>>> but we it comes to the ra.xml, we always use the first upper case word to
>>> define the properties, such as:
>>>        <config-property-name>DatabaseName</config-property-name>
>>>        <config-property-type>java.lang.String</config-property-type>
>>> and that causes the program logic in the config module builder should
>>> deal with that specificly...programmer might hate that..
>>>
>>> So, if either the user or developer will get un-happyness on this
>>> configuration, why not we build the GBeanInfo with a caseless name
>>> indentifid GAttributeInfo?
>>>
>>> -Rex
>>> Jun 23
>>>
>>
>>
>

Re: Build the GBeanInfo with the attribute name caselessly?

Posted by Rick McGuire <ri...@gmail.com>.
David Jencks wrote:
> Perhaps I can be convinced otherwise but I think the attribute and 
> reference names should remain case sensitive.  Are there other DI 
> systems that have case insensitive property names?  What does 
> blueprint do?

Blueprint is case sensitive for property names, using the JavaBeans 
convention.  However, because of how case gets folded when looking for 
the setter, "thisProperty" and "ThisProperty" would both work....not 
totally casesensitive, just an artifact of the rules used for 
constructing the method name.

Rick
>
> I don't like case insensitive file systems either :-)
>
> I'm not exactly sure what connector code you are thinking of, can you 
> point to it more specifically?
>
> thanks
> david jencks
>
> On Jun 23, 2009, at 6:06 AM, Rex Wang wrote:
>
>> Build the GBeanInfo with the attribute name caselessly?
>>
>> Currently, we build the GBeanInfo attribute according to the java 
>> code convention. However, we user set the attribute throught the 
>> plan, he have to pay attention to the case of the attribute name, 
>> such as:
>>         <gbean name="SMTPTransport">
>>             <attribute name="host">${SMTPHost}</attribute>
>>             <attribute name="port">${SMTPPort}</attribute>
>>         </gbean>
>> and
>>         <gbean 
>> name="org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5-SNAPSHOT/car,j2eeType=GBean,name=uniquename2" 
>> load="false" 
>> gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
>>             <attribute name="keepAliveTimeout">60000</attribute>
>>             <attribute name="maxThreads">40</attribute>
>>             <attribute name="acceptCount">10</attribute>
>>             <attribute name="connectionTimeout">60000</attribute>
>>             <attribute name="connectionLinger">-1</attribute>
>>             <attribute name="address">0.0.0.0</attribute>
>>
>> but we it comes to the ra.xml, we always use the first upper case 
>> word to define the properties, such as:
>>         <config-property-name>DatabaseName</config-property-name>
>>         <config-property-type>java.lang.String</config-property-type>
>> and that causes the program logic in the config module builder should 
>> deal with that specificly...programmer might hate that..
>>
>> So, if either the user or developer will get un-happyness on this 
>> configuration, why not we build the GBeanInfo with a caseless name 
>> indentifid GAttributeInfo?
>>
>> -Rex
>> Jun 23
>


Re: Build the GBeanInfo with the attribute name caselessly?

Posted by David Jencks <da...@yahoo.com>.
Perhaps I can be convinced otherwise but I think the attribute and  
reference names should remain case sensitive.  Are there other DI  
systems that have case insensitive property names?  What does  
blueprint do?

I don't like case insensitive file systems either :-)

I'm not exactly sure what connector code you are thinking of, can you  
point to it more specifically?

thanks
david jencks

On Jun 23, 2009, at 6:06 AM, Rex Wang wrote:

> Build the GBeanInfo with the attribute name caselessly?
>
> Currently, we build the GBeanInfo attribute according to the java  
> code convention. However, we user set the attribute throught the  
> plan, he have to pay attention to the case of the attribute name,  
> such as:
>         <gbean name="SMTPTransport">
>             <attribute name="host">${SMTPHost}</attribute>
>             <attribute name="port">${SMTPPort}</attribute>
>         </gbean>
> and
>         <gbean name="org.apache.geronimo.configs/tomcat6/2.1.5- 
> SNAPSHOT/car?ServiceModule=org.apache.geronimo.configs/tomcat6/2.1.5- 
> SNAPSHOT/car,j2eeType=GBean,name=uniquename2" load="false"  
> gbeanInfo="org.apache.geronimo.tomcat.connector.Http11ConnectorGBean">
>             <attribute name="keepAliveTimeout">60000</attribute>
>             <attribute name="maxThreads">40</attribute>
>             <attribute name="acceptCount">10</attribute>
>             <attribute name="connectionTimeout">60000</attribute>
>             <attribute name="connectionLinger">-1</attribute>
>             <attribute name="address">0.0.0.0</attribute>
>
> but we it comes to the ra.xml, we always use the first upper case  
> word to define the properties, such as:
>         <config-property-name>DatabaseName</config-property-name>
>         <config-property-type>java.lang.String</config-property-type>
> and that causes the program logic in the config module builder  
> should deal with that specificly...programmer might hate that..
>
> So, if either the user or developer will get un-happyness on this  
> configuration, why not we build the GBeanInfo with a caseless name  
> indentifid GAttributeInfo?
>
> -Rex
> Jun 23