ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Aviation Business Project using a Flight Simulator

<< < (2/3) > >>

CodeTRUCKER:
Your plans sound ambitious and complicated. Therefore, I say go with a proper database and thus a table within said database. That way, no matter how complicated it gets, you already have a place where you can stow all the stuff. One-to-many relationships are tough in plain text, nevermind many-to-many ones which are a complete hell.
-worstje (July 22, 2011, 02:34 PM)
--- End quote ---

Alrighty then, I have to learn how to do it, so is php my friend, or MySQL, etc.?  I don't mind doing the work, but I need a push in the right direction.  :)

How would you do it?

worstje:
They serve different purposes. PHP is for the logic, MySQL is for the data (and thus also the relationships between the data).

Proper database design is a course on its own, and I really can't begin to explain the finer points. A good one to keep in mind however is that you should never duplicate data (example: storing John's birthdate twice, once for his passport and once for his birth certificate), and that a field can only describe a single thing (example: list of hotel rooms on the fourth floor should NOT be a comma seperated '401,402,404,405' but instead the proper database relationships should be used so such information can be stored and properly queried). Finally, it also pays to keep in mind that a table should be considered to represent the blueprint of an entity, and a record in said table is such an entity.

To be honest, I am way too tired to go into your specific project. But I'd imagine an airplane table (which describes the aircraft), pilots (describing pilot qualifications), flights (which describes flights of different aircrafts with different pilots), pilot_log (storing dated log entries for all the pilots), etc. Just try to work out in your mind what sort of relationships the various pieces of data have to each others. One on one? Many on many? One on many? Etc.

Try looking at the various images on this pagae for inspiration and a better understanding of what I am trying to get across. If you split all the data up sensibly, a proper SQL query can be launched from PHP at any time to get exactly the data you need. (Example: All of Pilot CodeTRUCKERs log entries between April and July, 2011. Or the amount of flights flown by him in Cessna model aircrafts.) The better your database schema, the easier the more difficult stuff becomes. (Comparitively speaking, anyway.)

CodeTRUCKER:
Worstje, that's a lot to chew on and exactly what I was looking for!  Thanks for your input.

I guess at this juncture I will...

@ ...chew on what you posted and explore your link.
@ ...search DC to find a good on PHP and MySQL.  I have an old copy of Sam's "PHP and MySQL Web Development" that is based on PHP 4, but it should give me a good start (~800 pages). 
@ ...give it some trial and error.
@ ...report back later or ask questions while I work through all the above.

steeladept:
If it helps any, the way I think of a database is this (it helps me to develop it conceptually):

An abstract object is a table:  Examples - aircraft, person, airport, etc.

Adjectives common to that object are your fields:  Examples for aircraft - color, engine size, engine type, etc.

Specifics about one particular object are your records:  Example for "My plane" - white, 185 hp, twin turbo, etc.

It doesn't go into the rules of who, when, how, where, or why; but it does make it easier to visualize the conceptual data structure to me.  The only thing it doesn't really explain are foreign keys which are how tables are joined together.  For this, I just remember that one field in one table (say person) is the same as one field in another table (say aircraft).  So in the aircraft table, you might only have one Beachcraft Premier I listing, and in the person table, it would show in an equally named field several times (once for each person owning one).  If all that makes sense to you, then you are much further ahead in database design than you think you are....and yet still so far to go.... :-\

CodeTRUCKER:
FYI - This is only the first stage of this project, i.e., setting up the DB and building the client.  The long-term goal of this project is to provide a realistic framework my children and others can experiment with starting and managing a virtual business.  Pursuant to this, what I would like to do in the future is to model...

@ A supply-and-demand market economy.
@ Real-life fuel sales, repair costs, maintenance costs, etc. according to location.
@ Real-life airplane and airport fixed-base operations (FBOs) purchases, etc.
@ Systematic "job" opportunities which will be seeded with A.I. and live-pilot buying and selling.
@ Accurate "wear" models of aircraft life which will be reflected in efficiency and performance.
@ The above "wear" will be based on "component" use and failure modeling.
@ ?????

As you can see this project is VERY ambitious and it will be years before it matures to everything envisioned.  In the meantime, the goal is to get some baseline interaction ("starting small") and build from there.  Besides coding, a massive amount of research will be necessary.  For example, consider how a poor pilot could impact the engine and airframe of the ubiquitous piston-engine Cessna 172 Skyhawk?  Modeling each engine component and airframe component is a daunting project.  Now imagine the interactions between each component and how a failure ( oil pump goes "boing!") could cascade through the others (piston rings, rods, etc.) and you get how large the project could grow.  As immense as all that adds up to, multiply it by the number of different aircraft models available and wowzee!  It's a big one (and I didn't mention turboprops and jets)!

Granted, I am trying to singularly accomplish with my feeble skills what whole corporations have been working toward for decades.  The chances I will succeed in everything is not realistic, but I will take the project as far as I can.  

To this end, there is an official forum for this specific project.  If this project sounds like something you would like dabble in every now and then send me a PM and I will provide more details.

It should be clear, but just so no one gets their tail twisted, this is in no way meant to proselytize anyone away from DonationCoder, but to allow any like-minded aviation enthusiasts a fuller participation in the project which would not be appropriate to do on the DC forums.  

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version