Flexible objects

Occasionally, I need an object that has a variable number of primitive members. For example, I have an object "ItemConfiguration. Depending on whether it was used by the FtpItem or TelnetItem, had a different set of channels (ftp needs, String username, String password, String publicDirectory; telnet would just username and password).

So far, I've extended vectors to retrieve objects based on the name.

ex.

SerializableAttribute public class ConfigVector extends vector < IndividualSetting > {}

public void getSetting (String id)
{
for (IndividualSetting currSetting: this)
{
If (currSetting.getId () .equals (id))
Return currSetting;
}
Returns a null value.
}
}

It's just something I came up with. What is the right way to do it?

First, the channels are not primitives.

Second, if you need a FtpItem to have a certain set of attributes and a TelnetItem to have a different game, why not define a FtpItemConfig class and TelnetItemConfig class?

Tags: Java

Similar Questions

  • Why the objects lose their properties of flexible layout when converting to a symbol?

    is there a solution?

    It drove me crazy, but I finally figured it...

    slide #1 - object on stage, % fixed width and height

    slide #2 - converted object in symbol - rocking % width/height in gray

    Slide #3 - symbol edit, instance of scaling to resize

    slide #4 - toggle % of width/height available again!

  • Paste an object floating in the new doc Pages?

    Exactly, what determines where an object is pasted into a document Pages 09 and is it possible to click and point so a floating image is inserted at a specific time?

    I work with two very large documents (900 inches wide by 11 inches high) containing areas of text and images.

    Document 1 is a rough work space where I assemble images and possible captions for a photo essay. Document 2 is where to place the caption of the image units, while keeping the separate objects. All the objects in the two docs are floating; None of them are online. I scroll back to work on the docs and drag and modify freely.

    I found that when I'm trying to copy and paste an object 1 Doc 2 Doc, if I first click on an object in the Doc 2, element Doc 1 copied will be pasted next to the Doc 2 object (which is usually on the right side of the document, since I work mostly from left to right). But other times it does not work: the object, I'm sticking will appear somewhere in the Middle, or well left of the Doc 2. Which means that I have to drag the path to the right, where I want to. It may take a very long time.

    I know it is not random, but I just can't understand what governs the implementation of an item floating in a document where nothing is online.

    I'm even ready to enter the coordinates of the extreme-right for an object sticking pages left. But Pages don't let me do.

    Can anyone help?

    Thank you!

    This is certainly a very large document.  But try this:

    If there is text after copying the photo and caption in the doc 1, doc 2 (probably your final document), click in the text in the area where you want to paste.  Then the dough, using the command paste in the Edit drop-down list or v on the keyboard command.  That should put the issue in the vicinity where you want.  Then, if it ends up being 'inline', use the Inspector on the right panel and reset the objects "float".  It should work.  However, I, too, find a little strange 5.6.1 Pages.  I prefer Pages ' 09.  He has a lot more flexibility.

  • Flexible control of target RT status?

    Hello

    I am developing a project that requires a computer that hosts a LabVIEW application to monitor the State of a target of RT (myRIO). The problem that I am running is that I would be able to control what phase the target RT work like initialize, Configure, Shutdown, Idle. This seems to appeal to a design of State Machine model, but the problem is I want to also make sure that the data from these different States are dependent on are configured properly before they exectured.

    So my question is this:

    Is there any existing design model that allows reliably queued from the different States to target control in real time, ensuring that whenever we queued a State 'set up', for example, all the data that the configuration depends on is queued to wait with her?

    What I thought:

    I thought that a table of desired States could take place within an object, and that we are only able to read the State of the object publicly; the table is deprived of the object. A set of publicly available methods in this category could if call so that for each addition of a new State of the queue of the State would be by a Subvi, which part connector sets of data dependencies. But I don't know how you get that works between the PC and the target of RT, since LVOOP is pass by value rather than pass by reference.

    I would really like to know your opinion.

    Hello

    Thanks for your help guys. I had considered shared Variables and these working initially obtained, but I expect a solution that would be a bit more flexible than static instanation of various control parameters which is usually what the shared Variable implementations seem to wait. I also wanted to create an architecture that has been a bit "more strict", I didn't issue varying across with 'next State' data types commands so that I could avoid error cases where data could be treated inappropriately. I felt as if the request were begging for OOP!

    To work around this problem, I created a design template which I dubbed him "The Smart State Machine", who uses LabVIEW classes to define the features of a given State in a class, rather than on the execution platform. I hope that this will lead to a more flexible design, allowing you to share the features of the target of RT in transmitting the new State objects, while also ensuring that data which are essential to the State are transmitted with it. I downloaded an example that illustrates its features here.

  • What is an xnode object?

    Okay silly question, but what is an xnode object? I saw them mentioned and I know they have something to do with the scripts. The LabVIEW help search gave nothing of what has been very helpful.

    I was playing with these guys a little bit lately and will offer a few thoughts, I won.  XNode is roughly the equivalent of an XControl comics.  It is organized like a normal library, and a .xnode file is basically XML as a file .lvlib.

    XNodes have some of the "capabilities" that you control by writing ability live.  They range from the drawing of the image, to specify the terminals to generate the actual code.  There is a lot of flexibility, you can adapt for wire types, resize nodes horizontally and vertically, to have configuration screens, text fields.  The downside is that there are a lot of luggage, IE. all these screws capacity should be around, so a simple VI with a unique XNode may require dozens of subVIs.  No problem when they come with LV, a bit of a brake to home built ones.

    I've been a promoter of the end regarding XNodes and I'll soon (I hope) to release my XNode assistant on the community.  It deals with the creation of XNodes and add capacity VIs and SubVIs.  It also simplifies the process for most of the core capabilities.  My favorite part is that it eliminates scripting in many cases.  You write a VI model, use my tool to the terminals of the tag on the comic book by clicking on an image and then simply generate a list of rules of XNode wiring lugs on the terminals of the BD.  I also have simple tools to bundle/unbundle inputs/outputs for expandable nodes very popular.

    The old claim was XNodes would be too complex and not the type of the 'customer experience' that LV users want.  I intend to prove them wrong, stay tuned.  Once, they said similar things about scripts...

    In the meantime, let me know if you can make sense of this

    http://forums.NI.com/T5/LabVIEW/truth-table-node/m-p/1293680

  • Startguidence - make a simple change in default values of an entity object

    Hi all!

    I want to do non-static values by default in some of the fields of an entity (ExtBankAccountsEO) object.

    I have JDeveloper on my pc, but not on the server where Oracle Financials is installed.

    So which is the best way to proceed?

    My first thought was to decompile ExtBankAccountsEO.class, add a create() method and then compile it on the server.

    But without changing ExtBankAccountsEO.java and compilation with

    javac - cp classes12.jar:classes ExtBankAccountsEOImpl.java

    I get an error of type

    ExtBankAccountsEOImpl.java:395: cannot find symbol

    symbol: class string

    location: oracle.apps.iby.schema.server.ExtBankAccountsEOImpl of the class

    public string getAttribute8()

    And similar to exception, subject, date and number.

    Am I missing something in the classpath or this is not possible?

    It comes to specific issue OA.

    Please close this thread and repost this in the space frame OA: OA Framework

    You should not change the standard evaluation office.  OA Framework gives you the flexibility of expansion.

    You can make extensions of EO/VO/AM/CO OPS.

    See the developer's Guide:

    Release of Oracle Application Framework 12.1.3 Developer's Guide (Doc ID 1107973.1)

    Release of Oracle Application Framework 12.2.4 Developer's Guide (Doc ID 1676216.1)

    See the section:

    Change the entity object default attribute values

    When you change standard files, there is a pervasive customization. He'll get scratched when a patch is applied which have this modified file.

    In rare cases, if we cannot get the specific critical functionality using customization, then we change the standard files WITH the APPROVAL of the CUSTOMER. (This is not supported by the Oracle Support)

    Also, the error message looks like SEO 'chain' rather than 'String. Check the line number ExtBankAccountsEOImpl.java:395

    See you soon

    AJ

  • State multi objects - how to create a State asset/down AND a visited State Captivate 9

    Hello

    I hope someone might be able to help me understand how I am best at what a "assets/down" State and a "visited" .

    I have a screen with a number of buttons - when the learner clicks on a button, they appear different information (easily click reveal sort of interaction) can I do now with the functionality of the State multi 9 Captivate object.

    But can I use "States" to show that they have visited a button.

    The scenario is as follows:


    Screen has 10 buttons.

    By example, Normal (not yet visited) - button is blue.

    Active/low (learner has selected the button)-button is purple.

    Visited - button is green.

    Thank you.

    Lisa

    Sorry, but Lisa doesn't quite ask on built-in States (Normal, Rollover, Down)! Read each question carefully, please.

    She questioned an integrated State and a State of 'Clicked', which is NOT at all.

    @Lisa the easiest way is to States. I use above all form buttons, because they are much more flexible than the old types of buttons. You see in this Panel of State of the object, I've changed the text on them and rolling to the bottom of the State, which is impossible for the transparent buttons and text and for text image buttons must be in the image, which means that whenever you want to change the text, you must re-create the three images. Not very friendly, because it must still occur in another program.

    You see that on top of the InBuilt three States I created a custom state "Clicked". Do not confuse this Panel: the button has the same size as in the integrated States, but the thumbnails have a fixed size, where the last State of the scene shows that three States integrated.

    If you want the State Down to be the same as the clicked State, you can do it as well, but I wanted to show that it's a different State. With this configuration, you can have the Clicked State, replacing the Normal State (attention: the flyover States and down will remain the same) after clicking on the button with this workflow:

    • Create a tip or shared action standard (in this article, I used shared actions: 1 share = 5 buttons toggle - Captivate blog )
    • Add the command "change the State of MyShapeButton, Clicked
    • Put the command you want to be executed by this button (like the jump to slide X)

    If you navigate away from this slide, the "Clicked" State is only kept in 9.0.1.320 - not in the previous version - if you check the option "Maintain state on the overview of the slide" which you will see in the upper part of the properties of the button panel.

    I would like to know if that's what you're looking for? If you want to have the rollover state change, you will need two buttons and will have to replace the first box of the other which shows all States in a version Clicked.

  • Hide various objects on different slides with the same tip Action

    I'm quite new to Captivate and because of that I'm fighting for the search feature, I need. I have a project of say 40 slides. On each slide, I have a button field on the left side guide and when clicked I have a window scroll from left to right, in the main frame of the window.

    Also on each slide is an object that displays specific information (usually in the form of text) with the previous buttons and following attached to it (its actually just a PNG image with the buttons "Previous" and "Next" with click boxes on them).

    The problem I have is when I click on the field guide that I want to hide this information object. I can easily do this in a tip for 1 slide action but when I want to the same tip action allows to always hide the information object of the current slide that I meet problems. If I was able to name objects of the same name is not a problem.

    The only "fast" solution I have is that each object information on each slide set to hide when I open the guide and then visible when I close the guide.

    Is their a better solution or does this supposed same matter?

    Thanks in advance

    Why you not time the objects for the rest of the project, always on top? In this case, you will have an ID (I recommend you even a group). BUT: This means that you cannot use boxes to click but must spend much more flexible form buttons.

    Why I like the shape buttons - Captivate 6! -Captivate Blog

    Apparently you are not familiar with the shared actions nor.

  • Find flexible adapters?

    Hi guys,.

    Can someone help me to modify this script to find all VM with flexible adapters regardless of the status of tools?

    If she could show the type of operating system that would be too great.

    # Get all VM objects

    $vms = get-view - viewtype virtualmachine

    # Set up an empty array

    $table = @)

    # For each virtual machine.

    Foreach ($vm to $vms)

    {

    # If the tools are not installed and there is a PCNet32 adapter in the list of hardware...

    If ($vm.guest.toolsstatus - eq "toolsNotInstalled" - and (($vm.config.hardware.device | % {$_-est [VMware.Vim.VirtualPCNet32]}) - contains $true))

    {

    # Then exit to an object and add it to the table

    $table += new-Object PSObject - property @{"Name" = $vm.name; "" ""} ToolsStatus "= $vm.guest.toolsstatus;" 'NicType' = 'Flexible'}

    }

    }

    # The table output. You can export to a CSV file or something else here.

    $table

    The following code finds all the vm with flexible adapters:

    # Get all VM objects
    $vms = get-view - viewtype virtualmachine-name property, config.hardware.device

    # Set up an empty array
    $table = @)

    # For each virtual machine.
    Foreach ($vm to $vms)
    {
    # If there is a PCNet32 adapter in the list of hardware...
    If ((($vm.config.hardware.device | % {$_-est [VMware.Vim.VirtualPCNet32]}) - $true))
    {
    # Then exit to an object and add it to the table
    $table += new-Object PSObject - property @{"Name" = $vm.name; "" ""} NicType' 'Flexible' =}
    }
    }

    # The table output. You can export to a CSV file or something else here.
    $table

  • Auto refreshing display objects when the new line in the table inserted on another computer

    Greetings,

    I'm using an application of ADF JDeveloper 11.1.2.4.0 its been used by 2 separate computers.

    It's the same application, but I shared with security ADF for the person (Secretary) will see the half view of the application

    and the other person (doctor), the other half seen. Basically, I put adf username expression (rendering) for each display mode

    the specific menu, buttons, tabs, etc.

    My problem is, say the Secretary, creates a doctor's appointment, rather than re - run display objects

    every X minutes on the advice of the doctor, is there a way to notify the application that the new data are inserted into the database and must be re/refresh-execute?

    I have about 100 objects from view and I don't want to discount/re-execute all objects from view because I don't know on what table a new record its been inserted.

    Appointment is just one example, there are many paintings that both views are connected to.

    Hello

    Here is the solution to your needs: http://matthiaswessendorf.wordpress.com/2010/01/22/flexible-active-data-service/.

    Instead of the pop-up window in the sample you would be re - run the table of appointment. Now all you need is a mechanism that informs the change, which may be a trigger in the database or application that updates the new appointment

    Frank

  • Database object dependencies

    Hi all

    We have problems using 'database object dependencies' feature located under "Application Builder"-> App #-> utilities-> database object dependencies.

    Some of our facility.  We use the APEX 4.2.1.00.08.  We have our objects of database spread across 3 different patterns on the same database (we'll call x 1, x 2 and x 3 for reference).  If so, we have distributed concessions that allow patterns access objects each and others.  We have 1 workspace with multiple applications.  Some of the applications is to analyze in the schema x 1, analyzes some parse in x 2 and x 3.

    We could see inconsistent results of the functionality of the database object.  In particular, when we have an application configured to analyze in x 1 and calculate dependencies, commonly see us return dependencies 0 and 0 errors of analysis.  If we pass this request to be analyzed in x 2 and again, he'll find many dependencies of object.  In another case, he'll find 16 dependencies when parsing as x 1, but much more than 80 during parsing as x 2.  We have created empty x 1 applications that have a simple report on a single table in the x 1 pattern and it can not find this dependence.  However, the change to the x 2 or x 3 and re-calculation will find the dependency.

    My first question is: how our x 1 pattern is so "messed up"?  Why the feature wouldn't work there when it works for the other 2?  Clues as to how we can solve this problem to be more reliable?

    Secondly, I did some research and it seems that this feature is based on: wwv_flow_theme_files.find_object_dependencies (p_flow_id = >: fb_flow_id, p_page_id = > null);


    We would like to understand how it works for 2 reasons:

    (1) so that we can perhaps to self-diagnose the weird problems we see above

    (2) so that we can wrap this procedure/package of some custom scripts to run from the back-end.  We have a lot of applications, and it would be great automate the features it offers through our change management process.


    No idea where there might be a documentation about this process?  Naturally, it is IP and protected and Oracle provided only a way to access it from APEX, but it would be great to operate more flexibly if possible.


    Thank you!



    Hi Jim,.

    by comparing the privileges on these 2 systems is a good idea. For example, you can spool the output of

    select grantee||': '||privilege||' on '||owner||'.'||table_name from dba_tab_privs where grantee in ('PUBLIC', 'X1', 'X2', 'X3') order by 1;
    select grantee||': '||privilege from dba_sys_privs where grantee in ('PUBLIC', 'X1', 'X2', 'X3') order by 1;
    select grantee||': '||granted_role from dba_role_privs where grantee in ('PUBLIC', 'X1', 'X2', 'X3') order by 1;
    select owner||': '||synonym_name||' -> '||table_owner||'.'||table_name from dba_synonyms where owner in ('PUBLIC', 'X1', 'X2', 'X3') and table_owner not in ('SYS', 'SYSTEM', 'XDB') order by 1;
    

    in a file on each instance and look at differences.

    Kind regards

    Christian

  • Types &amp; confusion of object

    Hi all

    10.2.0.4
    SLES 10

    I have not yet uses types and objects eversince. And how to use it even if I read the docs, I'm confused. :(

    For example, I create type with the same description as the EMP table:
    create or replace 
    TYPE             "EMP" AS OBJECT (
    EMPLOYEE_ID                             NUMBER(6),
     FIRST_NAME                              VARCHAR2(20),
     LAST_NAME                               VARCHAR2(25),
     EMAIL                                       VARCHAR2(25),
     PHONE_NUMBER                         VARCHAR2(20),
     HIRE_DATE                                DATE,
     JOB_ID                                      VARCHAR2(10),
     SALARY                                     NUMBER(8,2),
     COMMISSION_PCT                       NUMBER(2,2),
     MANAGER_ID                              NUMBER(6),
     DEPARTMENT_ID                         NUMBER(4));
    How is different from the EMP table? How to use or manipulate this?

    I can also count (*), update, delete, insert and truncate her?

    Thank you very much

    zxy

    Published by: yxes2013 on 21.4.2013 19:11 > > > adding versions

    yxes2013 wrote:

    So it's more a java programmers? This is the reason why I have not the slightest idea or interest that the use of this thing.

    Nothing to do with Java. Everything about an extra set of database tools to use in the development of solutions.

    An object type is called a class in an object oriented programming language.

    // create an abstract class as parent class for defining animals
    SQL> create or replace type TAnimal is object(
      2          animal_id       integer
      3  ) not final;
      4  /
    
    Type created.
    
    // create a subclass under animals for horses - it is  a "final"
    // class and cannot be further sub-classed
    SQL> create or replace type THorse under TAnimal(
      2          horse_type      varchar2(20),
      3          horse_color     varchar2(50)
      4  ) final;
      5  /
    
    Type created.
    
    // we can create a persistent container, aka SQL object table,
    // for a class - including abstract classes
    SQL> create table animals of TAnimal(
      2          constraint pk_animals
      3          primary key( animal_id)
      4          using index
      5  );
    
    Table created.
    
    // we can insert any subclass into the SQL object table
    SQL> insert into animals values( THorse(1,'Appaloosa','Blanket with spots') );
    
    1 row created.
    
    // we see the abstract class properties when querying the table
    SQL> select a.* from animals a;
    
     ANIMAL_ID
    ----------
             1
    
    // we can also select all horses (sub-class) from the list of animals
    SQL> select
      2          a.animal_id,
      3          treat(value(a) as THorse).horse_type    as HORSE_TYPE,
      4          treat(value(a) as Thorse).horse_color   as HORSE_COLOR
      5  from       animals a
      6  where      value(a) is of (THorse)
      7  /
    
     ANIMAL_ID HORSE_TYPE           HORSE_COLOR
    ---------- -------------------- --------------------
             1 Appaloosa            Blanket with spots
    
    // we can now add new subclasses to an existing parent class
    SQL> create or replace type TDog under TAnimal(
      2          dog_name        varchar2(10)
      3  ) final;
      4  /
    
    Type created.
    
    // and we can add objects of this class to the existing animals
    // (parent class) table - note that the table had no idea that dogs
    // existed at the time it was created
    SQL> insert into animals values( TDog(2,'Lassie') );
    
    1 row created.
    
    // we can look at the objects stored in the animals container
    SQL> select value(a) as ANIMAL_OBJECT from animals a;
    
    ANIMAL_OBJECT(ANIMAL_ID)
    --------------------------------------------------
    THORSE(1, 'Appaloosa', 'Blanket with spots')
    TDOG(2, 'Lassie')
    
    // we can process the objects via standard SQL
    SQL> select
      2          a.animal_id,
      3          case
      4                  when value(a) is of (TDog) then
      5                          'Animal is a dog called '||
      6                          treat(value(a) as TDog).dog_name
      7                  when value(a) is of (THorse) then
      8                          'Animal is horse breed '||
      9                          treat(value(a) as THorse).horse_type
     10                  else
     11                          'Unknown animal'
     12          end     as COMMENTS
     13  from       animals a;
    
     ANIMAL_ID COMMENTS
    ---------- -------------------------------
             1 Animal is horse breed Appaloosa
             2 Animal is a dog called Lassie
    
    SQL>
    

    This shows, quite simply, how object classes can be created and used as lines and tables.

    Classes can also be used to add new SQL types to help you deal with complex SQL queries. For example, in {message identifier: = 10962761}, a type is used to provide a list of the values in columns in a sorted order.

    Classes can also be used to define structures SQL that is returned and populated by data sources NON-SQL. For example, in {message identifier: = 10158148}, data CSV from a web interface are transformed into a SQL data and an SQL interface using object types and using a pipeline to do what it's designed to do - turn data.

    Object classes also supports of the more flexible interfaces in the PL/SQL language. Instead of a caller directly using something like DBMS_PIPE, a class can be created that provides a much more flexible and intuitive interface for the caller to use.

    So not - nothing to do with Java. Everything about a new set of tools in SQL and PL/SQL (not this again, like a lot of this was introduced in Oracle 8i and have since been improved on new versions).

    One of the best examples of this new feature, is the type of custom object XMLTYPE SQL data - have a look at it. It's an excellent showcase for how a class should look like, what methods it should support and type of features, it must provide.

  • How to make the added objects part of the document

    When I make a document and add text boxes for arrows, lines, etc... for the document and then send the document to individuals, objects appear in the attached document in their email, but objects do not print. How to integrate these objects into the document permenantly so they will still print and cannot be moved or changed. I tried security so that they can be moved or changed. But still does not print objects.

    If you do not want to keep features to comment on such objects, you can flatten that transforms their regular appearances page table of contents. There are a number of ways to do this, but the following free JavaScript-based tool is the most flexible: http://www.uvsar.com/projects/acrobat/flattener/

  • Oracle PL SQL programming object

    Hi all

    I have problems of programming with objects in database oracle plsql, I'm not finding what I'm looking for on the net, maybe someone has the examples either explained websites for me?

    Thanks to you all

    LinoPisto wrote:

    My idea on the programming of the object was:

    declare
    my_lettura Lettura_Obj;
    ...
    Start
    ...
    UTL_FILE. GET_LINE (fHandler, buf);

    You are on the right track.

    The buf variable will be a string variable. You must analyze and extract the values. I guess that's a line of value (CSV) separate characters?

    There are a number of ways to analyze. You can write a function for example as in {message identifier: = 2416747}. You can also use the SQL and regular expressions to process more rules more complex analysis.

    Once you have extracted the string values, you must create an object for her. Objects are create through their Builder.

    The default constructor is simply call to your type of object and passing as parameters, the attributes defined in the object class. For example, if you have 10 attributes defined for the type of object TMyObject, then the default constructor is:

    TMyObject( val1, val2, val3, val4, val5, val6, val7, val8, val9, val10 )
    

    In the PL/SQL code, you will use it in the following way:

      --// declare an object variable
      myObject TMyObject;
    begin
      .. code ...
    
      --// creating an object
      myObject := new TMyObject( val1, val2, val3, val4, val5, val6, val7, val8, val9, val10 );
    
      .. code ...
    

    In SQL, you must create it as follows:

    select
        TMyObject( sysdate, col1, rowid, col2, user, 'funky value', 123, col3, col4, col5+col6 ) as MY_OBJECT
    from some_table
    

    Object oriented programming in PL/SQL using SQL (object class definitions) data types can provide a lot of flexibility when done correctly for technical reasons.

  • Statement of the object as the type

    Hello

    I just discovered a very basic thing on the statements of the subject and references after half a year of learning:
    It does not compile:
    Object o = new Dog(); 
    o.grrrr(); 
    Could someone point me to an article where it is explained in detail?

    I'm in the dark here, but I try a few questions:
    -What can and cannot be done with a typed object reference as an ancestor of the class of the object, it refers?
    -What are the advantages and disadvantages of do?
    -J' tried with an interface as type and I can't use the fields for the object being referenced there either, so this will only make good reference to all the?

    -I don't see why we can declare an object such as an interface type or ancestor if ultimately we cannot use this reference to reach the fields of the object.
    It is only in that way we can iterate over objects whose type can vary? But even in this case, we cannot use the fields throughout the iteration.

    Thank you very much in advance for any commments on this.

    lemonboston wrote:
    Hello

    I just discovered a very basic thing on the statements of the subject and references after half a year of learning:
    It does not compile:

    Object o = new Dog();
    o.grrrr(); 
    

    Could someone point me to an article where it is explained in detail?

    Varialbe o type is reference-object. Which is determined by the object o, at compile time. That's all the compiler cares when decide how o may be used.

    I'm in the dark here, but I try a few questions:
    -What can and cannot be done with a typed object reference as an ancestor of the class of the object, it refers?

    You can use a reference in a way that is consistent with its type of compilation. Note that you can get o the dog and then use the reference obtained as a reference-to-dog expression, but you generally won't go up if you don't have to.

    -What are the advantages and disadvantages of do?
    -J' tried with an interface as type and I can't use the fields for the object being referenced there either, so this will only make good reference to all the?

    Glasses for the coding of the interface. The general idea is, roughly speaking, 'all I care is that I have the list. I don't like which particular implementation of list is (ArrayList, LinkedList, etc.), so he does these things that promises to the interface of the to do list. The details of how it does are not important to me. "This gives you the flexibility and, for example, allows the provider from the list on the RIGHT side of the = to give you different implementations according to what is appropriate at this time here during execution.

    -I don't see why we can declare an object such as an interface type or ancestor if ultimately we cannot use this reference to reach the fields of the object.

    Each object of dog IS - YEAR and each ArrayList IS - A list and IS - AN object and Collection of IS - A, etc. Google for oriented object is a relationship and the liskov substitution principle

    This is really more general stuff OO Java stuff, even if of course Java, like other OO languages, has its own details as to how it supports these concepts.

Maybe you are looking for