Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Program overall structure

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Program overall structure

    Hello,

    First messages in this forum. Coming from Actionscript, I migrated to Java especially because of better memory management and OpenGL libraries available.

    After following all the basic tutorials I found, I am now trying to design a more "professional" (that I am not) application but I didn't find any good tip about the overall workflow of a program:

    My app is based on an OpenGL window, fullscreen. But in order to display my window, I need to load different files in a sequencial way:

    - a init.xml file which defines different behaviours for screen and navigation
    - a engine.xml file with some tags related to OpenGL features
    - a config.xml file which describes the structure of a dynamic tree in my program
    - some .obj files (3D meshes) whose path are defined in the previous xml file
    - I also need to perform some tests related to presence/absence of some specific connected devices

    Here are my questions about this process:
    - I have no idea what is the best practice for achieving this. I imagine that a lot of programs require such initialisation files but is xml the usual choice or method?
    - Can I make the program opening a DOS window to see the loading progress and status of these loadings and then close it just before to run my OpenGL window? Or is it best to open a kind of splash screen with some labels/progressbars?

    Any tip would greatly help me to move on from simple tutorials to the next level of programming.
    Thanks in advance guys!


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Program overall structure

    Quote Originally Posted by badoumba View Post
    - I have no idea what is the best practice for achieving this. I imagine that a lot of programs require such initialisation files but is xml the usual choice or method?
    You probably aren't going to find a single "best" practice for this kind of thing. This is going to depend entirely on the context of your application and even your own personal preferences. Just do whatever seems most natural to you, and update your approach as you grow as a developer.

    Quote Originally Posted by badoumba View Post
    - Can I make the program opening a DOS window to see the loading progress and status of these loadings and then close it just before to run my OpenGL window? Or is it best to open a kind of splash screen with some labels/progressbars?
    Either approach works, and again it really depends on the context of your application.

    All of that being said, you might want to check out a framework like LWJGL.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Program overall structure

    Hi Kevin

    Thanks for your feedback. XML is nice to work with and I used to do this with FlashBuilder, so flexible. I'll probably continue with this and code a XMLLoaderManager on top for handling the sequencial process. I am pretty sure this already exists somewhere.

    And yes, LWJGL is the libraries I am using already!

Similar Threads

  1. Structure
    By Gerardgrundy in forum Object Oriented Programming
    Replies: 8
    Last Post: November 3rd, 2012, 02:25 AM
  2. [SOLVED] am i using the right structure for applet?
    By hwoarang69 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: October 23rd, 2012, 11:24 PM
  3. Re: Data Structure
    By jim17 in forum Object Oriented Programming
    Replies: 3
    Last Post: November 16th, 2011, 11:14 PM
  4. Help with java decision structure program
    By kingsnans in forum Object Oriented Programming
    Replies: 4
    Last Post: November 5th, 2011, 10:54 AM