Thread: Java hierarchy

Results 1 to 3 of 3
  1. #1 Java hierarchy 
    Registered Member
    Join Date
    Jan 2013
    Posts
    85
    Thanks given
    3
    Thanks received
    4
    Rep Power
    24
    Hierarchy is a large bloodline of derivative classes. The pinnacle (the foundation of the oo design) of the Hierarchy is the Object class. The object class vaguely represents any object. Giving the user an object oriented programming ability. Even if you don't extend the Object class in one of your classes the compiler will compile the code with the object class as the parent.

    Personal frameworks can utilize hierarchy as well. Utilizing inheritance allows you to vaguely represent things in your application that are going to need to be duplicated. This prevents unnecessary overlap in classes. Instead of rewriting the code for every single entity in an application you can use a hierarchy to encompass something vaguely and reuse it an infinite amount of times. A hierarchy can have multiple levels of inheritance. I popular hierarchy model in game making and rsps development is having a Node at the highest point of your hierarchy that represents Mob (Players, Npcs), Objects, and Items; only the utmost vague representation. You can use the node class as a parent for the entity which would still represent everything encompassed in the node just more thoroughly detailed. The entity can than be used to parent classes which are detailed representations of what they are (IE: Mob, Objects, Items). The mob class should be written a fashion that it can encompass both Npcs and players without giving too much or too little detail.
    That is just one of many possible hierarchies. You can really use the ability of a hierarchy to encompass whatever you want.
    This image depicts the hierarcy above:
    This image depicts an employee related hierarchy.

    I don't know if there is any area of the hierarchy that I could go into more detail about. If anyone would like to see code examples of an hierarchy that can be provided. Hopefully this information can be utilized to make many complex and effective frameworks.

    Inheritance (The Java™ Tutorials > Learning the Java Language > Interfaces and Inheritance)

    Sidenote: This information pertains to the @Override notation. This notation is used to tell the compiler that a method is being referenced. The annotation allows the programmer to know that the method of the parent class has been referenced in a subclass. So: the code functionality most likely serves a different purpose than that of the parent. The @Override notation is not necessary but it aides in compilation.
    Reply With Quote  
     

  2. #2  
    Renown Programmer

    Join Date
    Dec 2010
    Posts
    2,876
    Thanks given
    508
    Thanks received
    1,898
    Rep Power
    5000
    cool good information, could be useful to someone maybe, rep++
    never talk to me or my wife's son ever again
    Reply With Quote  
     

  3. #3  
    Registered Member
    Mister Maggot's Avatar
    Join Date
    Dec 2008
    Posts
    7,227
    Thanks given
    3,283
    Thanks received
    2,875
    Rep Power
    5000
    While it's appreciated you took the time out to write this, I don't think it properly explains the point of inheritance.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Rune-Server Hierarchy
    By Stewie in forum Spam
    Replies: 1
    Last Post: 07-24-2011, 09:23 AM
  2. New to java? Detailed videos on helping with an IDE and learning java
    By Silicity in forum Application Development
    Replies: 1
    Last Post: 04-21-2011, 06:07 AM
  3. Replies: 14
    Last Post: 11-01-2010, 11:29 PM
  4. Replies: 7
    Last Post: 09-06-2009, 06:05 AM
  5. Replies: 116
    Last Post: 10-15-2008, 08:13 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •