adfemg
  1. adfemg
  2. ADFEMG-94

[ADFng1-04014] - View object instance names

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Labels:
      None

      Description

      hi

      Please consider naming guidelines [ADFng1-04001] and [ADFng1-04014] in the "ADF Naming and Project Layout Guidelines v1.00" [1].

      [ADFng1-04001] - Application module view object instances - Individual instances of view objects exposed through an application module should follow the "convention over configuration" guideline and maintain the same name as the view object name they are based on. ...

      [ADFng1-04014] - View object instance names - An Application Module can expose the same view object multiple times. On creating a view object instance in the Application Module Wizard or Editor the IDE will default its name to the view object with a numerical suffix. Remove the numerical suffix but maintain the view object name. If this results in a collision in instance names rename each view object instance such that their unique purpose is clear.

      Trying to avoid using the same name for different things, is a general guidline that can help to avoid confusion.

      In case of naming guidelines [ADFng1-04001] and [ADFng1-04014], confusion about when a name refers to a View Object definition or a View Object instance can be avoided by adding a suffix "VI" to the View Object instance name.
      Such confusion could occur in different ways, e.g. with references to View Object instances in Page Definition files or with the names shown in the Data Controls panel.
      Because it is important to properly make a difference between View Object definitions and View Object instances, at design-time and at run-time, it does not seem like a good idea to give these the exact same name.

      Given that different naming guidelines [1] suggest to "have the suffix", this also does not seem to conflict with naming guideline [ADFng1-01014], "Don't use Hungarian notation".

      many thanks
      Jan Vervecken

        Issue Links

          Activity

          Hide
          chriscmuir added a comment -

          Thanks for loding the issue Jan.

          The response here will be the same as ADFEMG-88.

          Show
          chriscmuir added a comment - Thanks for loding the issue Jan. The response here will be the same as ADFEMG-88 .
          Hide
          Jan Vervecken added a comment -

          Thank you for the update Chris.

          The general guideline "trying to avoid using the same name for different things" does not imply Hungarian notation.

          The goal of Hungarian notation is to include information about what a name is referring to (like a data type).
          The goal of a suffix "VI" to the View Object instance name is to avoid using the same name for different things, to avoid confusion.

          The problem of Hungarian notation is, if the information included in the name (like a data type) changes, the name should change.
          Currently I don't see how a View Object instance can change, so that it is no longer a View Object instance.

          Also, I don't really see the difference with a naming guideline like [ADFng1-04018], suggesting 'View object names should always have the suffix "View"', which also seems intended to "avoid using the same name for different things".

          It is because the context of where a name is used is not always sufficient to exactly determine what a name really refers to, that one could value "trying to avoid using the same name for different things" more than trying to avoid Hungarian(-like) notation. So any other "different name", that is not Hungarian(-like) but still makes sense, would be acceptable.

          Sure, these naming guidelines include "... where you have your own preference, certainly diverge from the guidelines ...".
          If you prefer to not discuss this feedback, you can close this JIRA issue.

          regards
          Jan Vervecken

          Show
          Jan Vervecken added a comment - Thank you for the update Chris. The general guideline "trying to avoid using the same name for different things" does not imply Hungarian notation. The goal of Hungarian notation is to include information about what a name is referring to (like a data type). The goal of a suffix "VI" to the View Object instance name is to avoid using the same name for different things, to avoid confusion. The problem of Hungarian notation is, if the information included in the name (like a data type) changes, the name should change. Currently I don't see how a View Object instance can change, so that it is no longer a View Object instance. Also, I don't really see the difference with a naming guideline like [ADFng1-04018] , suggesting 'View object names should always have the suffix "View"', which also seems intended to "avoid using the same name for different things". It is because the context of where a name is used is not always sufficient to exactly determine what a name really refers to, that one could value "trying to avoid using the same name for different things" more than trying to avoid Hungarian(-like) notation. So any other "different name", that is not Hungarian(-like) but still makes sense, would be acceptable. Sure, these naming guidelines include "... where you have your own preference, certainly diverge from the guidelines ...". If you prefer to not discuss this feedback, you can close this JIRA issue. regards Jan Vervecken
          Hide
          steven.davelaar added a comment -

          As said in issue ADFEMG-96, I hate suffixes, they undermine readability, they are a PL/SQL thing not a Java/OO thing.
          For this particular case, I don't see how you can ever confuse a view object with a view object instance, because in your Java code you ALWAYS work with a view object instance. So, I think it is actually a good thing if a VO and VO instance have the same name when there is no specific ViewCriteria defined for the VO instance. If there is a VC defined then the VO instance name should refelect this e.g "OpenOrders" and "ClosedOrders" for a VO named "Orders"

          Show
          steven.davelaar added a comment - As said in issue ADFEMG-96 , I hate suffixes, they undermine readability, they are a PL/SQL thing not a Java/OO thing. For this particular case, I don't see how you can ever confuse a view object with a view object instance, because in your Java code you ALWAYS work with a view object instance. So, I think it is actually a good thing if a VO and VO instance have the same name when there is no specific ViewCriteria defined for the VO instance. If there is a VC defined then the VO instance name should refelect this e.g "OpenOrders" and "ClosedOrders" for a VO named "Orders"
          Hide
          chriscmuir added a comment -

          Thanks for the feedback Steven. As result I agree and I'm closing this issue with "won't fix".

          Show
          chriscmuir added a comment - Thanks for the feedback Steven. As result I agree and I'm closing this issue with "won't fix".
          Hide
          Jan Vervecken added a comment -

          Thanks for your reply Steven.

          • about "... I hate suffixes, they undermine readability, they are a PL/SQL thing not a Java/OO thing ..."
            • By default, also JDeveloper suggests names with suffixes in different places ... seemingly "trying to avoid using the same name for different things".
          • about "... I don't see how you can ever confuse a view object with a view object instance ..."
            • Still, someone's experience with ADF could play a role here.

          regards
          Jan Vervecken

          Show
          Jan Vervecken added a comment - Thanks for your reply Steven. about "... I hate suffixes, they undermine readability, they are a PL/SQL thing not a Java/OO thing ..." By default, also JDeveloper suggests names with suffixes in different places ... seemingly "trying to avoid using the same name for different things". about "... I don't see how you can ever confuse a view object with a view object instance ..." Still, someone's experience with ADF could play a role here. regards Jan Vervecken

            People

            • Assignee:
              Unassigned
              Reporter:
              Jan Vervecken
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: