Results 1 to 4 of 4
  1. #1
    SirRawlins is offline Member
    Join Date
    Dec 2007
    Location
    Chichester, West Sussex
    Posts
    3
    Rep Power
    0

    Default What is this Object relationship?

    Hello Chaps,

    I'm new to the forums so a big hello to you all as a strarter. I'm also relativly new to JAVA, however I'm comming from a background in web development, mainly Adobe ColdFusion so have a pretty fair working knowledge of the language and the methodology behind it.

    I've spent this morning studying the different logging frameworks available to us, mainly the native logging API supplied as part of the platform, and also the Log4J which comes from apache I believe, both of which seem perfectly extensive and simple enough to use.

    Whilst studying their documentation and source code I've found a particular type of object relationship I've not seen before and was hoping you'd be able to shed a little light on exactly how it works.

    If you wouldnt mind taking a look at the API doc for the 'Level' class which can be found here Level (Java 2 Platform SE v1.4.2) you'll notice that the class appears to contain multiple instance of itself as the properties, is that right? I've not seen this type of composition before, what is it called? and what are the benefits of using it?

    I'm also trying to understand exactly what a 'field' is. is this just a publicly accessible property inside the class which is accessible without a getter? or somthing slightly different?

    Thanks for any info guys, I look forward to speaking with you all over the comming weeks.

    Rob

  2. #2
    ShoeNinja's Avatar
    ShoeNinja is offline Senior Member
    Join Date
    Oct 2007
    Posts
    124
    Rep Power
    0

    Default

    Interesting question. I'm going to look into that myself. I have some ideas and I think I know how they are used but it's all speculation at this point. Keep me updated on what you find and I'll do the same.

  3. #3
    SirRawlins is offline Member
    Join Date
    Dec 2007
    Location
    Chichester, West Sussex
    Posts
    3
    Rep Power
    0

    Default

    Hey Shoe,

    Well I've been searching for the past few days on this and I'm still none the wiser on how it works, it seems to be some form of subclassing perhaps, but I've only ever handled subclassing using 'extends' so I'm assuming this isnt proper subclassing, perhaps subclassing through compoisition? I dont know, its got me baffled :-D

    Rob

  4. #4
    ShoeNinja's Avatar
    ShoeNinja is offline Senior Member
    Join Date
    Oct 2007
    Posts
    124
    Rep Power
    0

    Default

    Sorry. I've been busy the last couple days and haven't had time to look. I take a peek when I get off work tonight.

Similar Threads

  1. Replies: 2
    Last Post: 11-26-2010, 03:12 AM
  2. How to update data for a JPA many-to-many relationship?
    By abhijit.sarkar in forum Enterprise JavaBeans (EJB)
    Replies: 1
    Last Post: 11-04-2008, 09:48 AM
  3. Object ID
    By javaplus in forum New To Java
    Replies: 4
    Last Post: 11-26-2007, 01:08 PM
  4. problem with ejb 3.0 entity beans with manyToMany relationship
    By makcro in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 07-26-2007, 08:37 PM
  5. Creating object of Type Object class
    By venkatv in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •