Object naming..

Okay, I'm going to make an attempt at explaining this and I'd sincerely appreciate any help offered.
I'm currently doing up a program that allows a person to create Friends. The thing that I want to ask you guys about is this: Is there anyway to create an automatic Object naming method? For example:
Person *a* = new Person();You see, if I create a method that automatically names every object a, wouldn't that mean that I am simply overwriting it? I don't want to have to type out a load of Object names and I'm pretty sure that that wouldn't be the best way to do it.
Regards.
Wayne

In this situation, you would do something like this:
public class MainClass {
    public static void main(String [] args) {
        Person [] people = new Person[10];
     people[0] = new Person("Larry");
class Person {
    String name;
    public Person(String n) {
     name = n;
}Or some other similar method of using a class field to represent the person's name.

Similar Messages

  • Why am I getting "There is already an object named '#TempTable...' in the database." within my SQL Server IF Statement

    The creation of My #TempTable is based on my input Parameter and I am getting "There is already an object named '#TempTable_Service_X_Claims' in the database." Why???
    USE [Report]
    GO
    DECLARE @ProviderType CHAR(1)
    SET @ProviderType = 'G'
    IF Object_ID('TempDB..#TempTable_Service_X_Claims') IS NOT NULL DROP TABLE [#TempTable_Service_X_Claims]
    IF @ProviderType = 'I'
    BEGIN
    SELECT...
    INTO [#TempTable_Service_X_Claims]
    FROM [dbo].[service_x]
    LEFT JOIN [dbo].[affiliation]
    ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
    AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
    AND [affiliation].[VOID] = ''
    AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
    AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
    WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
    AND [service_x].[C_EFF_DATE] <= '12/31/2013' --AND [affiliation].[PRAC_NBR] = @PracticeNbr
    AND [affiliation].[PRAC_NBR] = 'F330'
    END
    -- THEREFORE, USE THIS QUERY FOR "G" GROUP SELECTION SINCE IT USES [NPI]
    IF @ProviderType = 'G'
    BEGIN
    SELECT...
    INTO [#TempTable_Service_X_Claims]
    FROM [dbo].[service_x]
    LEFT JOIN [dbo].[affiliation]
    ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
    AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
    AND [affiliation].[VOID] = ''
    AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
    AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
    WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
    AND [service_x].[C_EFF_DATE] <= '12/31/2013'
    AND [affiliation].[NPI] = '1700947884 '
    END
    Thanks in advance for your review and am hopeful for a reply.
    PSULionRP

    The creation of My #TempTable is based on my input Parameter and I am getting "There is already an object named '#TempTable_Service_X_Claims' in the database." Why???
    USE [Report]
    GO
    DECLARE @ProviderType CHAR(1)
    SET @ProviderType = 'G'
    IF Object_ID('TempDB..#TempTable_Service_X_Claims') IS NOT NULL DROP TABLE [#TempTable_Service_X_Claims]
    IF @ProviderType = 'I'
    BEGIN
    SELECT...
    INTO [#TempTable_Service_X_Claims]
    FROM [dbo].[service_x]
    LEFT JOIN [dbo].[affiliation]
    ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
    AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
    AND [affiliation].[VOID] = ''
    AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
    AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
    WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
    AND [service_x].[C_EFF_DATE] <= '12/31/2013' --AND [affiliation].[PRAC_NBR] = @PracticeNbr
    AND [affiliation].[PRAC_NBR] = 'F330'
    END
    -- THEREFORE, USE THIS QUERY FOR "G" GROUP SELECTION SINCE IT USES [NPI]
    IF @ProviderType = 'G'
    BEGIN
    SELECT...
    INTO [#TempTable_Service_X_Claims]
    FROM [dbo].[service_x]
    LEFT JOIN [dbo].[affiliation]
    ON [affiliation].[AFF_NBR] = [service_x].[AFF_NBR]
    AND [affiliation].[PROV_NBR] = [service_x].[Prov_Nbr]
    AND [affiliation].[VOID] = ''
    AND [affiliation].[c_ymdeff] <= [service_x].[C_EFF_DATE]
    AND [affiliation].[c_ymdend] >= [service_x].[C_EFF_DATE]
    WHERE [service_x].[C_EFF_DATE] >= '1/1/2013'
    AND [service_x].[C_EFF_DATE] <= '12/31/2013'
    AND [affiliation].[NPI] = '1700947884 '
    END
    Thanks in advance for your review and am hopeful for a reply.
    PSULionRP
    Is it possible that this procedure is being executed more than once concurrently (even against different databases)) within the instance?
    Microsoft SQL Server Storage Engine PM

  • Is there any best practice or standard for database object naming ?

    Hi
    Thank you for reading my post
    is there any standard or best practice for databse objects naming ?
    for example how should we name columns of a table ? should it be like TOTAL_VOTE or TOTALVOTE and many other items.
    Thanks

    what does oracle suggest as a naming schema for tables , fields , views. indexes , tablespaces , ... If you look at the data dictionary you will see that not even Oracle keeps rigidly to any specific standard, although there are tendencies :)
    "The nice thing about standards is that there are so many of them to choose from."      
    -- Andrew Tannenbaum
    Cheers, APC

  • Question about Best Practices - Redwood Landscape/Object Naming Conventions

    Having reviewed documentation and posts, I find that there is not that much information available in regards to best practices for the Redwood Scheduler in a SAP environment. We are running the free version.
    1) The job scheduling for SAP reference book (SAP Press) recommends multiple Redwood installations and using export/import to move jobs and other redwood objects from say DEV->QAS->PROD. Presentations from the help.sap.com Web Site show the Redwood Scheduler linked to Solution Manager and handling job submissions for DEV-QAS-PROD. Point and Shoot (just be careful where you aim!) functionality is described as an advantage for the product. There is a SAP note (#895253) on making Redwood highly available. I am open to comments inputs and suggestions on this issue based on SAP client experiences.
    2) Related to 1), I have not seen much documentation on Redwood object naming conventions. I am interested in hearing how SAP clients have dealt with Redwood object naming (i.e. applications, job streams, scripts, events, locks). To date, I have seen in a presentation where customer objects are named starting with Z_. I like to include the object type in the name (e.g. EVT - Event, CHN - Job Chain, SCR - Script, LCK - Lock) keeping in mind the character length limitation of 30 characters. I also have an associated issue with Event naming given that we have 4 environments (DEV, QA, Staging, PROD). Assuming that we are not about to have one installation per environment, then we need to include the environment in the event name. The downside here is that we lose transportability for the job stream. We need to modify the job chain to wait for a different event name when running in a different environment. Comments?

    Hi Paul,
    As suggested in book u2018job scheduling for SAP from SAPu2019 press it is better to have multiple instances of Cronacle version (at least 2 u2013 one for development & quality and other separate one for production. This will have no confusion).
    Regarding transporting / replicating of the object definitions - it is really easy to import and export the objects like Events, Job Chain, Script, Locks etc. Also it is very easy and less time consuming to create a fresh in each system. Only complicated job chains creation can be time consuming.
    In normal cases the testing for background jobs mostly happens only in SAP quality instance and then the final scheduling in production. So it is very much possible to just export the verified script / job chain form Cronacle quality instance and import the same in Cronacle production instance (use of Cronacle shell is really recommended for fast processing)
    Regarding OSS note 895253 u2013 yes it is highly recommended to keep your central repository, processing server and licencing information on highly available clustered environment. This is very much required as Redwood Cronacle acts as central job scheduler in your SAP landscape (with OEM version).
    As you have confirmed, you are using OEM and hence you have only one process server.
    Regarding the conventions for names, it is recommended to create a centrally accessible naming convention document and then follow it. For example in my company we are using the naming convention for the jobs as Z_AAU_MM_ZCHGSTA2_AU01_LSV where A is for APAC region, AU is for Australia (country), MM is for Materials management and then ZCHGSTA2_AU01_LSV is the free text as provided by batch job requester.
    For other Redwood Cronacle specific objects also you can derive naming conventions based on SAP instances like if you want all the related scripts / job chains to be stored in one application, its name can be APPL_<logical name of the instance>.
    So in a nutshell, it is highly recommend
    Also the integration of SAP solution manager with redwood is to receive monitoring and alerting data and to pass the Redwood Cronacle information to SAP SOL MAN to create single point of control. You can find information on the purpose of XAL and XMW interfaces in Cronacle help (F1). 
    Hope this answers your queries. Please write if you need some more information / help in this regard.
    Best regards,
    Vithal

  • Change Existing objects naming conventions in a Query

    Hi all,
    I Need to change the Naming Conventions of the Query Objects of a Query at the Infoprovider level. Is there any Routine to change the naming conventions or do i need to do it Manually.

    Hi gopinath,
    mine is also a similar case, the problem with the option u gave me is that our implementation is in EDW environment and rework from the scratch is not an option for me. Is it possible to change the query objects naming convention at particular info-provider level, i have about 200 objects created with random naming convention and to be now changed according to a standard naming convention. I need to also consider how the changes effect other queries and reports as well.. So is there any possible way of Custom coding a routine or a program that can solve my purpose.. has any one gone through the same situation?
    thanks,
    kishore

  • Association and ViewLink Object naming

    Hi,
    Jdev: 11.1.1.6
    I have recently upgraded to jdev 11.1.1.6. While creating BC objects, the associations and view links are created with weird names like 'SysC0012692Assoc' -{which actually is a fk between Calendar and CalendarPeriodicities entities} and 'SysC0012692VL' -{Which is a view link over the previously created association) and this is the case with all the associations and view links created.
    I never faced this earlier on 11.1.1.5 or 11.1.1.4 versions. Is there any setting under preferences that needs to be turned off to get the regular naming with understandable names. Or am i missing something.
    Thanks,
    Srikanth.
    Edited by: 905147 on May 6, 2012 11:10 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Srikanth,
    JDeveloper derives default association names by converting the foreign key constraint names to a Java-friendly name and adding the Assoc suffix.
    so if the foreign key name in the database is SysC0012692, then the association name will be SysC0012692Assoc.
    >
    I never faced this earlier on 11.1.1.5 or 11.1.1.4 versions.
    >
    please re-check the FK name in the database?
    are you sure that you did not rename the association after Jdeveloper created it?

  • Oracle Object Naming Standards/Conventions

    I did a search on the Inet regarding recommended object (table, column, keys, ..., audit columns) naming conventions. I found different approaches, but I would like to know if there's a document with the naming conventions Oracle recommends/is using?
    Thanks.

    I have visited http://www.dba-oracle.com/standards_schema_object_names.htm
    Oracle column naming Standards
    Column Naming Standards
    Column names should be spelled out whenever possible.
    If a column name should exceed 30 characters, reduce the size of the column name in this order:
    From the left of the column name, remove vowels from each word in the table name except for the first vowel of each word.
    If the column name is still greater than 30 characters, use standardized shorthand indicators. Record this standard for consistent use.
    I agree with the author that column names should be spelled out whenever possible. Some Oracle official database examples use abbreviations for column names but
    I would prefer to user long Column Name that spells out the actual name.
    For example, in Scott/tiger sample database, for EMP table, it is better to spell out the full name of column name so that UI design could be easier for the programmers.
    EMPNO Employee_No
    ENAME Employee_Name
    JOB Job
    MGR Manager_Employee_No
    HIREDATE Hire_Date
    SAL Salary
    COMM Commision
    DEPTNO Departmen_No
    Since Forms Builder 10g and JDeveloper ADF can generate forms/applications using wizards, using a full column name will be better than an abbreviation, as the prompt for Item is automatically converted by Forms,
    e.g. The prompt for Customer_Number becomes "Customer Number"
    If you use abbreviation in column names, you need to change the prompts of generated forms manually.
    Message was edited by:
    wyfwong

  • BO Business Object Naming Convention

    Hi experts,
    we are about to implement SAP Business objects (previously using only using SAP BW). As part of the implementation we are creating a naming convention / standard for Webi and Universe. Is there anything published on SDN or the web regarding naming conventions / standards or is anyone willing to share some tips.
    BR
    Anders

    Hi Anders,
    In regards to naming your universe objects, please take a look at my blog post re Universe Best Practices (Link: [http://geek2live.net/posts/universe-design-best-practices/]).
    I would always recommend naming universe objects (classes, dimensions, measures etc) in business terminology and being explicit in the definition.  For instance, an object called 'Sales' could be interpreted many different ways.  Is it Sales Revenue, Count of Sales Orders, Count of Sales Order Lines, Average Sales Amount, etc etc?
    Your universes should also be named explicitly so users understand exactly what it contains.  Another example - a Finance universe could contain many things - is it General Ledger Actuals, General Ledger Budgets, Fixed Assets, Accounts Payable etc..
    The most important thing imho, is to define a standard that everyone who is designing universes uses, without exception.  Otherwise the standards don't mean anything to the end users.
    Good luck!
    Josh

  • Finding an Object named (thisStr)???

    Hi,
    Im trying to find an object (specifically a jscrollpane) with the name of a string variable.... for example...
    String[] array = {"myStr","another","andanother"};
    JComboBox fileList = new JComboBox(array);
    fileList.addActionListener(this);
    JScrollPane myStr = new JScrollPane();
    JScrollPane another= new JScrollPane();
    JScrollPane andanother= new JScrollPane();
    public void actionPerformed(ActionEvent evt) {
    if (evt.getSource() == fileList) {
    JComboBox cb = (JComboBox)evt.getSource(); 
    JScrollPane selItem = (JScrollPane)cb.getSelectedItem();  //won't cast here
    // sets other scrollpanes to not visible          
    for (int j=0;j<3;j++){
         JTable desItem = (JTable)cb.getItemAt(j);               desItem.setVisible(false);
    //makes selected scrollpane visible                    
    showTable(selItem);
    protected void showTable(JScrollPane selItem){
         selItem.setVisible(true);
    }I simply want to select a scrollpane with the combobox and make that one visible, and the other not visible... I currently have the list inside the combobox with the same names as the actual scrollpanes....
    How do I get it to work?? Now it gives me some cast error?

    I am unsure what you are doing exactly but I can only hope that the line
    where you attempt to cast a JTable as something which inside your
    combo box is just a silly error and not a true reflection of your GUI.

  • Custom LegacyData Storage: Database Custom Objects Naming for 12i and 10G..

    We are planning a migration from VMS system to release 12.0.0.1, Oracle 10g database.
    We need to retain legacy data in the same database as the oracle apps. We are achieving the same by defining custom
    schema to hold the data back up from legacy. This will be a typical sqlldr load, data volume expected is around 460 GB.
    My questions:
    1. To avoid patch applied in future overwrite the custom legacy tables, will it be safe to have
    the schema prefixed as “XX”.
    2. Will other custom database objects like tables, packages, views etc within the custom schema; have to be defined with
    “XX” as a prefix to their names?
    3. Is it safe to have a non-apps related data (legacy constraintless data in the same database) in a schema and database
    objects without prefixed as “XX” ?
    Thanks a lot in advance...!! :)

    Not able to use # in custom sql is a known bug that wil be fixed in 11. The only workaround I can come up with is not using parameters and prepare the query "by hand" before using it:
        ValueReadQuery query = new ValueReadQuery("SELECT F_NAME# FROM EMPLOYEE WHERE EMP_ID = 1");
        query.checkPrepare(session, null);
        Object result = session.executeQuery(query);TopLink requires pk to keep object identity. Map in MW the field(s) that uniquely identify the row as pk. Pk may consist of more than one field, the only limitation is that all the pk fields can't be set to null.

  • Confusion about object naming

    i have 3 jsp files, b1.jsp, b2.jsp, b3.jsp which are similar files (all with similar contents, except that b1.jsp has a form while the other 2 don't), all using the same class (Bean2.java), with id="bea". when b1.jsp is run and i refresh the page, a certain attribute of the bea object is changed (i think due to the form) such that the result displayed is different.
    i believe it has to do with my form. but why is it that when i run b2.jsp and b3.jsp, that same attribute is also changed? is it cos i give the same name to the object of Bean2 class?
    hope u all know what i sam saying.

    hope to make myself clearer. b1.jsp is changed cos it has the form. but i din't know y b2.jsp n b3.jsp also has that particular attr changed

  • Scope rules for object naming

    Can anyone explain how the object names are resolved in ORACLE. Ex: can i have a table name and the name of the index on that table same.

    Indexes are an exception. Pretty much every other object type - VIEW, FUNCTION, PACKAGE, PROCEDURE, TYPE, SEQUENCE, SYNONYM - is going to throw ORA-955. The reason is quite clear: we don't use index names in select statements, so the duplicate name doesn't matter. But it does matter with everything else. For the object types enumerated above the object name has to be unique within a schema.
    I would argue that indexes ought to have unique names, even if Oracle doesn't enforce that.
    Cheers, APC

  • OOP dynamic naming of objects

    I'm creating an instance in this way:
    var newhouse:House = new House();
    But I need to create fourty of these objects named:
    "newhouse1","newhouse2",...,"newhouse40"
    How can I name the var dynamicly, since the syntax won't
    allow brackets

    Well, at least to me, having all the instances located in an
    array is
    cleaner. I realize it's not _really_ cleaner, I just like
    sticking stuff
    into arrays. <g>
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Dynamically catch a function call from an object at runtime

    Hi,
    I have a bit of an interesting question.
    Say I have a dynamic object named Foo. It may have a set of explicitly defined functions:
    public function helloWorld():String
         return "hello world";
    public function get name():String
         return "My Name";
    etc.
    I want to be able to create a further function
    public function handleFunctionCall(functionCall:String, args:Array):*
         trace("Function: " + functionCall + " was called with the arguments:");
         for(var i:int=0; i<args.length; i++)
              trace(args[i]);
    The purpose of this is so that I can declare the object Foo and then call any function and handle it accordingly at runtime.
    e.g.
    var foo:Foo=new Foo();
    foo.bar();
    foo.whathaveyou();
    foo.whatever();
    Hope someone can point me in the right direction.

    I'd be interested to know more about what you are trying to achieve, but the code below should work:
    public function handleFunctionCall( functionName : String, args : Array ) : *
       var functionToCall : Function = this[ functionName ];
       return functionToCall.call( this, args );
    For alternative approaches you may want to take a look at behavioural design patterns. The command or strategy pattern may suit your needs.

  • Problem with initial download of a data object

    Dear All,
    I have created a data object named "EQUIPMENT", which has three nodes. EQUIPMENT is the header node, DETAILS is the child node to EQUIPMENT and LOCATION is the child node to DETAILS. I have also done explicit key mapping to DETAILS and LOCATION.
    I have selected the following as the BE Keys in the nodes.
    SERIAL NO in EQUIPMENT header node.
    TYPE in DETAILS node.
    ZIPCODE in LOCATION node.
    In the explicit key mapping of DETAILS node we have selected "SERIAL NO" field in this node.
    In the explicit key mapping of LOCATION node we have selected "SERIAL NO" and "TYPE" fields in this node.
    Data object contains no errors and i have activated the data object and it was successful.
    Then i have also created back adapter which has EQUIPMENT get list and get detail. Get list returns only serial numbers (which is the BE key in EQUIPMENT node). Get detail takes "serail no" as input, returns "DETAILS" and "LOCATION" data in tables parameter. I have tested the get list and get detail interfaces, they are working fine. Then i have activated back end adapter and that was successful.
    Now i have triggered an initial download for the  "EQUIPMENT" data object, but there is no data downloaded into the data object. I have checked the monitoring in administration portal, it is showing status "Ended with errors", but there is no details of an error.
    So can you please let me know what could be mistake i have done or how to check what is the error. Please help us to resolve the issue.
    Regards,
    Kiran.

    Hi Kiran
    Are you checking in the NWMA>>Monitoring>>Logs and Traces>>Backend Integration?  The logs should have the proper error.
    If not can you regenerate the DO, edit and activate your adapter and try again?
    Regards
    Rohith

Maybe you are looking for