Variable/method names standardizing

Hi All,
The problem we've got here is that same things are named in slightly different way by different developers or development groups.
Typical example:
'id' property. accessors could be named like: 'getID' or 'getId'.
Or even better example: term 'Work List' implementation of which has nothing to do with Java List. So, property could be named as 'worklist' or 'workList' with similar names for accessors.
I think, this problem is slightly outside of coding standards scope. And as project is very massive ~300000 lines of code, there are a lot of different terms named like in example above.
Has anyone come across such problem before?
I suspect, solution would be to keep a kind of variable/method names library.
Are there any better solutions?
Thanks in advance
Andrei

I think, this problem is slightly outside of coding
standards scope. It is, and I'm glad it is because the "people" who make the standards that we do have end up creating dumb, inconsistent stuff as it is. Better they don't get too granular.
Has anyone come across such problem before?Every day
I suspect, solution would be to keep a kind of
variable/method names library.
Are there any better solutions?How you name stuff is a matter of opinion. I personally don't care if you do someID or someId or even someid, what kills me is stuff like someid and someid. But again, it's all what you're used to.

Similar Messages

  • Changing Variable & Method Names

    I wish to call a colour from the java.awt package, & want to be able to enter the colour on the fly. how do I call 'theColourIWant' & append it to the end so I get Color.theColourIWant.
    Another example would be to create multiple instances of a class by incrementing the name by one each time ie
    myClass c1 = new myClass;
    myClass c2 = new myClass;
    & so forth by perhaps using a 'for' statement to increment c1 to c2 & higher. How do you call the new name after appending the incremented number to the 'c'.

    There is nothing to stop you from creating a class that extends the java.awt.Color like this:
    public class myColor extends Color {
        public final static Color myWhite          = new Color(255, 255, 255);
        public final static Color myLightGray   = new Color(192, 192, 192);
        public final static Color myGray            = new Color(128, 128, 128);
        public final static Color myDarkGray   = new Color(64, 64, 64);
        public final static Color myBlack          = new Color(0, 0, 0);
    }Then you can just use myColor.myWhite
    V.V.
    PS: If this helps, don't forget the Dukes!

  • SSDT vs 2013 and Clr function, call a Clr method name dynamically using SQLCMD variables

    Hello,
    My question is this, hopefully this makes sense:
    How could I got about doing this, inside a SQL function, I would like to re-name the Clr method call based on a SQLCMD variable? 
    I have a Clr project to encrypt/decrypt data, there are different method names depending on the deployment types.
    For the definition of a function called dbo.EncryptThis, I would like to use a SQLCMD variable to change the name depending on SQLCMD variables. This works fine in SQL Server Mgmt studio, but VS 2013 fails to recognize the SQLCMD variable and the build fails
    with: "Error
    1
    SQL71521: A method with a matching signature was not found in the loaded assembly.".
    THis code works fine in SQL Server Mgmt Studio, but fails to build in the SSDT project.
    In the SSDT project I have the SQLCMD variable defined and think I have SQLCMD mode enabled, by doing this:
    Right click file > Execution Settings > SQLCMD mode
    CREATE FUNCTION [dbo].[EncryptData]
    (@str NVARCHAR (MAX))
    RETURNS NVARCHAR (MAX)
    AS
    EXTERNAL NAME [CryptoClrAssembly].[LibName].[EncryptData$(MethodName)]
    Is this even possible in SSDT? or would I have to do this in a post-deploy script?

    Hi Kevin,
    Thanks for the info.
    Bummer, so the only other solution I have is to create a post-deploy script to change the function based on a SQLCMD variable or other logic?
    What would be really cool, would be if during the build process the SQLCMD variables would get replaced with the default value to the SQLCMD variable, thus would allow to build the project. Also, during deployment, if someone entered an incorrect method
    from the assembly it would just fail.

  • How to convert a String variable as class name and method name?

    i have two classes
    class Student
    public String insertStudent(String sname)
    { return("Student has been inserted ");     }
    class Teacher
    public String execute(String methodName, String className)
    {  //return statement of the method 'insertStudent' in the class 'Student'; }
    }Now, i have a class with the main method. Here, i would like to call the method *'insertStudent'* of class *'Student'*
    using the method *'execute'* of class *'Teacher',* passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Can anyone please help me out. Thanks
    regards,
    chinglai

    You should have just added that as a comment on your [initial posting|http://forums.sun.com/thread.jspa?threadID=5334953] instead of starting a new thread.
    Now, i have a class with the main method. Here, i would like to call the method 'insertStudent' of class 'Student'using the method 'execute' of class 'Teacher', passing the method-name and the class-name (viz. insertStudent, Student) as the
    String parameter.
    Why oh why? What do you want to achieve?
    Let me tell you: there is a way to do what you try to do, but it's not recommended and should be used only very sparingly. Especially not in anything like your code, that resembles normal business logic (as opposed to an application framework such as Spring, for example).
    Can you explain what exactly you want to do with that? Why should a Teacher be able to call any random method ony any other class. And what good would that do?

  • Using oc4j to generate interfaces from wsdl produced improper method names

    The method names that were produced from the opperations in my WSDL, generated an interface file with incorrect method names. The name went from "DoTest" in the wsdl to "doTest" in the Interface file.
    I double checked and all the cases are correct in the wsdl.
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by John Reynolds (MedPlus) -->
    <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:y="http://localhost/TestService" targetNamespace="http://localhost/TestService">
         <types>
              <xs:schema targetNamespace="http://localhost/TestService" xmlns="http://www.w3.org/2001/XMLSchema">
                   <xs:element name="Tresult" type="xs:string"/>
                   <xs:element name="Tname" type="xs:string"/>
                   <xs:element name="Tfault" type="xs:string"/>
              </xs:schema>
         </types>
         <message name="DoTestResponse">
              <part name="Result" element="y:Tresult"/>
         </message>
         <message name="DoTestRequest">
              <part name="Name" element="y:Tname"/>
         </message>
         <message name="DoTestFault">
              <part name="ExceptionDetail" element="y:Tfault"/>
         </message>
         <portType name="TestService">
              <operation name="DoTest">
                   <input message="y:DoTestRequest"/>
                   <output message="y:DoTestResponse"/>
                   <fault name="DoTestException" message="y:DoTestFault"/>
              </operation>
         </portType>
         <binding name="TestService" type="y:TestService">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
              <operation name="DoTest">
                   <soap:operation soapAction="urn:#DoTest" style="document"/>
                   <input>
                        <soap:body use="literal"/>
                   </input>
                   <output>
                        <soap:body use="literal"/>
                   </output>
                   <fault name="DoTestException">
                        <soap:fault name="DoTestException" use="literal"/>
                   </fault>
              </operation>
         </binding>
         <service name="TestServiceSoap">
              <port name="TestService" binding="y:TestService">
                   <soap:address location="http://localhost/TestService"/>
              </port>
         </service>
    </definitions>

    Obviously one could rename the operation to that standard, but that doesn't exactly strike me as being anything other that a work around for a bug.
    WSDL provides a contract in which multiple languages have to conform to a set of interfaces, and it's not exactly good to have a tool, just a assume the contract for an interface is wrong.
    I could argue that I'm only doing Java on the front end and .Net on the client side and that they don't neccessarily follow the Java convention, nor should be constrained by it.
    I do agree with you that they probably just followed the convention when writing to code generator and just happened to pick up the convention. They just need to fix it now.

  • Where will i get the method code and method name in Bpc

    Dear Experts,
    Thanks for watching this thread at the time of creating Consolidation methods they have
    NEW
    HOLDING
    GLOBAL
    PROPORTIONAL
    EQUITY
    lEAVING (END OF THE YEAR)
    LEAVING(DURING THE YEAR)
    Where will i get the method Code and method name.
    Can you please guide me.
    Regards,
    Srinivasan.

    The consolidation methods types you have listed are the standard ones  provided by BPC for Consolidation Method types.
    You can set the Consolidation Methods in the BPC Administration Console under Business Rules Library -> Consolidation Methods.
    There you can see some defaults - you can remove these and set your own if you prefer.
    You should read the BPC340 Training guide.

  • Declare a variable typed "name of a class"-Need help

    I have "segment" class in package named Ex13
    import Exercise12.Point123;
    public class segment {
         private Point123 start;
         private Point123 end;
         public segment(Point123 start, Point123 end) {
              this.start = start;
              this.end = end;
         public double length() {
              return start.distance(end.getX(), end.getY());
         public String midlePoint() {
              return (end.getX() + start.getX()) / 2 + " "
                        + (end.getY() + start.getY()) / 2;
              // return insidePoint(1,1);
         public Point123 insidePoint(double m, double n) {
              double ratio = m / (m + n);
              return new Point123(start.getX()+(end.getX() - start.getX()) * ratio,
                        start.getY()+(end.getY() - start.getY()) * ratio);
    //return (start.getX()+(end.getX() - start.getX())*ratio);
    }And class "Point123" in package Ex12:
    public class Point123 {
         private double x;
         private double y;
         public Point123(double xAsis, double yAsis) {
              x = xAsis;
              y = yAsis;
         public double getX() {
              return x;
         public double getY() {
              return y;
    //     public String toString() {
    //          return String.format("%.1f,%.1f", x, y);
         public boolean isOrigin() {
              return x == 0 && y == 0;
         public boolean isOnX_Axis() {
              return y == 0;
         public boolean isOnY_Axis() {
              return x == 0;
         public double distance(double xAsis, double yAsis) {
              return Math.sqrt(Math.pow(xAsis - x, 2) + Math.pow(yAsis - y, 2));
    }I remove toString method in Point123 class, but whenever I call insidePoint method in segment class it print out "Exercise12.Point123@addbf1". In other hand, I don't remove toString method, I call insidePoint method,then it prints out the correct result which I want.
    I think the reason why this thing happened is that I am using Point123 return type in insidePoint method. To midlePoint method in segment class, it does not affect whether I remove toString or not. That is because I use its own String return type.
    Can someone tells me whether my thought is correct or not? And explain more about variable typed "name of a class"

    Oh! My header's segment class does not have extend...., therefore it inherit from the Object. But what is Object in my class?
    is it "*s*" in my code?
    public class DisplayResult {
         public static void main(String[] args) {
                   segment s  = new segment(new Point123(3,4), new Point123(6,7));
                   System.out.println(s.length());
                   System.out.println(s.midlePoint());
                   System.out.println(s.insidePoint(1.5,4));
    }

  • Extracting method names from JNI probes

    Hello.
    I would like to use the Call* probes from the hotspot_jni provider. These probes provide as argument a "method id". My question is how I can extract, for instance, the method name from this ID. I saw that JNI provides a method "GetMethodName" but being a dtrace novice, I am unsure how to obtain a handle to the JNI api from within dtrace.
    Any hint would be greatly appreciated.
    Best wishes,
    Eric

    Actually, it can be done. Otherwise, how do you think debugger shows variables and formal parameters?
    You should compile your aplication with debuginng information (for details see tools doc). Then you have 3 options:
    1) run application under debugger and use JVMDI to get everything you want;
    2) use bytecode libraries (BCEL, CGLib etc) to read class file and fetch required information through their API
    3) write your own class file parser based on class file format described in Java Virtual Machine Specification
    First way is quite complex and is definitely not for "production use".
    Second way is the best in case you have time limitations, but size of your application will be increased because of thrid-party libraries.
    Thrid way is the best if you have application size restrictions and have enough time to write simple class file parser to fetch that specific information (1-2 days depending on your experience).
    Have fun ;)

  • How to use method of Standard Class

    Hi all,
                  I want to call a pop up in pcui screen in some standard application with some text. I have made Zclass of  standard SAP class which i am using (cl_bsp_accmod_contact in CRM system).
    I think i have to call 'PRINT_STRING' method of  standard class CL_BSP_ELEMENT.
    <i>I am trying to use this code: </i>
    <b>
    data: lr_data type ref to cl_bsp_element.
      concatenate html 'rohit' into html.  (html is a string)
      lr_data->print_string( html ).</b>
    <u>but it gives a dump:</u>
    You attempted to use a 'NULL' object reference (points to 'noth
    access a component (variable: "lr_data").
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    I dont know how to assign object reference to an object???
    Plz help me in this regard,
    Thanks in advance,
    Rohit

    Hi ,
    try and use :
    data: lr_data type ref to cl_bsp_element.
    concatenate html 'rohit' into html. (html is a string)
    lr_data->print_string( html = html ).
    You are creating a variable...but not passing the value to the parameter...it is exactly like callin get_data or get_cell_value...!!
    Hope this helps.
    <i><b>Do reward each useful answer.</b></i>
    Thanks,
    Tatvagna.

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • Using a variable to name a window?

    Is it possible to use a user-defined variable to name a
    window? I'm hoping to set up a "template" system of sorts for a
    family of products, all of which are very similar. I'd just like to
    name the window accordingly to the product name via a variable if
    possible.

    Hi there
    If this is a feature you feel would be a valuable addition to
    those offered by RoboHelp, consider telling the Adobe RoboHelp
    Development team about it. You may do that by
    clicking
    here and completing the form.
    Cheers... Rick

  • Variable file name through Receiver mail Communication channel

    I need to send a file through receiver communication channel   with the following name ( YYMMDD schema)  . The YYMMDD is current date .  I know how to create these file names throug FCC ( file communication channel) , I tried in the same manner to create this file through Receiver Mail CC , but it did not work  .  If you have any ideas , can you please share with me ?
    ABC_MMYYDD.TXT
    Thanks.
    Ritvik

    Hi Ritvik,
    Also, Please look at this link and see if it helps you. It is generating variable file name through a UDF
    Re: Problem in dynamically file name generation procedure
    Best Regards

  • How to get the method names in a class

    hi  friends,
    Could any of you tell me the report or function module  to display all the method names in a given class.
    thanks in advance.
    regards,
    kumar

    Hi Kumar ,
    Open ur class in SE24 transaction ,there is a tab for methods ..
    u'll get the list of methods form there ... n in source u'll get their operative details
    Regards
    Renu

  • Failed to parse method name:

    Hi,
    I've the following environment:
    - Sun Solaris
    - WL 61 without service pack
    - jdk 1.3.1
    I wrote a simple Session Bean and make it IIOP enabled.
    For the Java-Corba client I use an IDL which describes
    the interfaces of the remote and home interface of the
    Session Bean.
    Everything works fine, that means I get the WL's NameService,
    home and the remote object. If I call a method of the remote
    object I got the following message:
    <Info> <IIOPEndPoint> <failed to parse method name: foundUnkownSubscriber>
    I found something in you newsgroup and you said the we should
    use SP2. Where can I get this SP2?
    Regards
    Andre Genser

    Andy Piper <[email protected]> wrote:
    "Andre Genser" <[email protected]> writes:
    I've the following environment:
    - Sun Solaris
    - WL 61 without service pack
    - jdk 1.3.1
    I wrote a simple Session Bean and make it IIOP enabled.
    For the Java-Corba client I use an IDL which describes
    the interfaces of the remote and home interface of the
    Session Bean.
    Everything works fine, that means I get the WL's NameService,
    home and the remote object. If I call a method of the remote
    object I got the following message:
    <Info> <IIOPEndPoint> <failed to parse method name: foundUnkownSubscriber>Are you sure you are spelling correctly? Seems like this should be
    foundUnknownSubscriber.
    andy
    -- Sorry Andy, it was the name but I didn't solved the problem. Now I got the following
    exception:
    <Apr 16, 2002 8:47:29 AM CEST> <Warning> <Dispatcher> <Error thrown by rmi server:
    'weblogic.rmi.cluster.ClusterableServerRef@111 - jvmid: '-5101001595216439928S:10.2.9.70:[8045,8045,9045,9045,8045,9045,-1]:agenser8045:myserver',
    oid: '273', implementation: '[BaseEJBObject] home: prototype.CallBackBean_w4a7u3_HomeImpl@29bced''
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    >
    <Apr 16, 2002 8:47:29 AM CEST> <Error> <Kernel> <ExecuteRequest failed
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    >
    What is wrong in my solution? Here is my simple IDL-File:
    module prototype{
         exception CallBackException {
         interface CallBack {
              void foundUnknownSubscriber( in string MSISDN) raises(CallBackException);
         interface CallBackFactory {
              CallBack create();
    Thanks.
    Andre

  • Get the method name

    hi
    can anyone know how to get the name of method from its catch block.
    For example
    i have a class called Hello.java
    and inside that a method called display();
    and i have a written the code inside a try catch block.so when an exception occurs i want to create a log file
    i got the class name using this.getClass().getSimpleName()
    so is there any way to get the method name , where the catch is written. (here in example i should get it as "display")
    plz help me
    im in great need.
    hope u understood my doubt.
    rgds

    Use a logging framework, and name the loggers well & use meaningful messages?
    Or create a Throwable, [fill in|http://java.sun.com/javase/6/docs/api/java/lang/Throwable.html#fillInStackTrace()] the stack trace, get the required StackTraceElement and [get the method|http://java.sun.com/javase/6/docs/api/java/lang/StackTraceElement.html#getMethodName()] from this.

Maybe you are looking for