[prev in list] [next in list] [prev in thread] [next in thread] 

List:       myfaces-dev
Subject:    Re: [TRINIDAD] public API review - SkinVersion
From:       Blake Sullivan <blake.sullivan () oracle ! com>
Date:       2010-10-29 21:35:21
Message-ID: 4CCB3E19.4090405 () oracle ! com
[Download RAW message or body]

I'm wondering if we're making the subclasser implement equals() in 
SkinVersion if we should make hashCode() abstract as well so that they 
remember to provide their own implementation there as well.

-- Blake

On 10/29/10 2:30 PM, Jeanne Waldman wrote:
> Hi,
>
> I've been asked to implement something called skin versioning into the 
> skinning framework. This is useful when you (the skinning developer) 
> want to update your skin, and you want to version it, so that an end 
> user can decide if he wants to uptake your new version without 
> changing the skin-family name, and keeping the skin-family name 
> version-free.
>
> In trinidad-config.xml, the application developer chooses the 
> skin-family to use. We will now have a skin-version field as well:
> <skin-family>purple</skin-family>
> *<skin-version>v2</skin-version>*
>
> The syntax *<skin-version>default</skin-version>* can be supported as 
> well to return the purple skin whose version is marked to be the 
> default skin in that skin-family.
> We could also add a *<skin-version>latest</skin-version>* so an end 
> user can say, "I always want the latest purple skin", and they'll 
> never have to change their trinidad-config.xml every time a new purple 
> skin version comes out.
>
> In trinidad-skins.xml (the skin developer) could add versioning to the 
> skins like this. The name of the version can be any String the skin 
> developer wants. Here we've chosen "v1" and "v2".
>
> <skin>
> <id>purple-v1.desktop</id>
> <family>purple</family>
> *<version>
> <name>v1</name>
> <default>true</default>
> </version>*
>   ...
> </skin>
> <skin>
> <id>purple-v2.desktop</id>
> <family>purple</family>
> *<version>
> <name>v2</name>
> </version>*
>   ...
> </skin>
>
> The SkinVersion will be a class and not simply a String so we can add 
> 'default' and maybe 'latest' flags to it.
> A Skin object will have a SkinVersion. A Skin object already has an 
> id, a family, a styleSheetName, etc.
>
> package org.apache.myfaces.trinidad.skin;
>
> /**
>  * You can version skins. The skin version works tightly with the skin 
> family.
>  * This allows someone to create versions of their skin, like purple, 
> purple-v2,
>  * purple-v3. Then the user can say which skin version they want, like:
>  * <skin-family>purple</skin-family><skin-version>v3</skin-version> 
> when they
>  * pick a skin in trinidad-config.xml.
>  * When creating a skin, you give it a version if you care about 
> versioning.
>  * When extending this class, you must override equals.
>  */
> abstract public class SkinVersion
> {
>
>   // when extending this class, you must override equals
>   abstract public boolean equals(Object o);
>
>   abstract public boolean isDefault();
>
>   abstract public String getName();
>
> }
>
> Let me know what you think.
>
> Thanks!
> Jeanne


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    I'm wondering if we're making the subclasser implement equals() in
    SkinVersion if we should make hashCode() abstract as well so that
    they remember to provide their own implementation there as well.<br>
    <br>
    -- Blake<br>
    <br>
    On 10/29/10 2:30 PM, Jeanne Waldman wrote:
    <blockquote cite="mid:4CCB3CDE.4080800@oracle.com" type="cite">
      Hi,<br>
      <br>
      I've been asked to implement something called skin versioning into
      the
      skinning framework. This is useful when you (the skinning
      developer)
      want to update your skin, and you want to version it, so that an
      end
      user can decide if he wants to uptake your new version without
      changing
      the skin-family name, and keeping the skin-family name
      version-free.<br>
      <br>
      In trinidad-config.xml, the application developer chooses the
      skin-family to use. We will now have a skin-version field as well:<br>
      &lt;skin-family&gt;purple&lt;/skin-family&gt;<br>
      <b>&lt;skin-version&gt;v2&lt;/skin-version&gt;</b><br>
      <br>
      The syntax <b>&lt;skin-version&gt;default&lt;/skin-version&gt;</b>
      can
      be supported as well to return the purple skin whose version is
      marked
      to be the default skin in that skin-family.<br>
      We could also add a <b>&lt;skin-version&gt;latest&lt;/skin-version&gt;</b>
      so an end user can say, "I always want the latest purple skin",
      and
      they'll never have to change their trinidad-config.xml every time
      a new
      purple skin version comes out.<br>
      <br>
      In trinidad-skins.xml (the skin developer) could add versioning to
      the
      skins like this. The name of the version can be any String the
      skin
      developer wants. Here we've chosen "v1" and "v2".<br>
      <br>
      &lt;skin&gt;<br>
      &nbsp; &lt;id&gt;purple-v1.desktop&lt;/id&gt;<br>
      &nbsp; &lt;family&gt;purple&lt;/family&gt;<br>
      <b>&nbsp; &lt;version&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;name&gt;v1&lt;/name&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;default&gt;true&lt;/default&gt;<br>
        &nbsp; &lt;/version&gt;</b><br>
      &nbsp; ...<br>
      &lt;/skin&gt;<br>
      &lt;skin&gt;<br>
      &nbsp; &lt;id&gt;purple-v2.desktop&lt;/id&gt;<br>
      &nbsp; &lt;family&gt;purple&lt;/family&gt;<br>
      <b>&nbsp; &lt;version&gt;<br>
        &nbsp;&nbsp;&nbsp; &lt;name&gt;v2&lt;/name&gt;<br>
        &nbsp; &lt;/version&gt;</b><br>
      &nbsp; ...<br>
      &lt;/skin&gt;&nbsp;<br>
      <br>
      The SkinVersion will be a class and not simply a String so we can
      add
      'default' and maybe 'latest' flags to it.<br>
      A Skin object will have a SkinVersion. A Skin object already has
      an id,
      a family, a styleSheetName, etc.<br>
      <br>
      package org.apache.myfaces.trinidad.skin;<br>
      <br>
      /**<br>
      &nbsp;* You can version skins. The skin version works tightly with the
      skin
      family.<br>
      &nbsp;* This allows someone to create versions of their skin, like
      purple,
      purple-v2, <br>
      &nbsp;* purple-v3. Then the user can say which skin version they want,
      like:<br>
      &nbsp;*
      &lt;skin-family&gt;purple&lt;/skin-family&gt;&lt;skin-version&gt;v3&lt;/skin-version&gt;
when
      they <br>
      &nbsp;* pick a skin in trinidad-config.xml.<br>
      &nbsp;* When creating a skin, you give it a version if you care about
      versioning.<br>
      &nbsp;* When extending this class, you must override equals.<br>
      &nbsp;*/<br>
      abstract public class SkinVersion<br>
      {<br>
      <br>
      &nbsp; // when extending this class, you must override equals<br>
      &nbsp; abstract public boolean equals(Object o);<br>
      &nbsp; <br>
      &nbsp; abstract public boolean isDefault();<br>
      &nbsp; <br>
      &nbsp; abstract public String getName();<br>
      <br>
      } <br>
      <br>
      Let me know what you think.<br>
      <br>
      Thanks!<br>
      Jeanne<br>
    </blockquote>
    <br>
  </body>
</html>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic