Hi all. I'm writing a web app for personal business use. It's a big job and will handle invoicing, payments, time scheduling and so on. I expect it will take the better part of 6 months or a year to finish in my spare time.
I've made a couple of false starts but seem always to end up with spaghetti code. My major obstacle is keeping the program aware of what it's current status is.
For example, there's a page to add a new customer, or a new supplier and they work fine. sometimes while entering an invoice it happens that the supplier or the customer or work location or something that does not exist. The app. needs to divert to the "New customer" page, get the data and return to the original point. While entering the new customer it might happen that the customer uses a bank that's never been entered before and so it needs to divert to the "New Bank" page and then backtrack to where it started.
To make the problem clearer - please consider the web-interface my bank uses. I have to log in to do anything at all. If I'm half way through a transaction and the session times out, I'm taken to the log-in page again, but after entering the login details I don't go to the main menu again ... it takes me to where I left off with the transaction. Somewhere behind the scenes a clever programmer kept track of what I was doing, so the log-in page can be re-used over and over at different points in a session. That's the kind of thing I need to do.
I've been using session variables and some hidden variables in the pages to assist but as the program grows it becomes cumbersome and confusing. There's an endless list of if's or's and's - rules and exceptions to rules.
Can anybody give some good generic advice about how to integrate and track all the various sub-components of a large application like this?
Thanks in advance.
Angus