sark9012
sark9012

Reputation: 5747

My classes and functions - is there a better way?

Just been looking at the way I am structuring my classes and wondering it there is a better way.

I have forms which pass the information through to the process class. This class just forwards everything onto my main class which then does the work. When the work is done, it then passes the information through to the database class to carry out the sql.

If in the main class there is an error, the error goes back to the process class. The process class sets a session variable true is the error is there.

It then goes to the referrer which is the original page and on that page I have code which leaves an error message if the session variable is present.

I know this possibly isn't the best way to explain things, but does it sound like a reasonable way to do things?

I am just trying to improve the way I write classes! Thanks

Upvotes: 1

Views: 99

Answers (1)

Saul
Saul

Reputation: 18061

The workflow you describe somewhat reminds MVC but it probably isn't. If you are interested in making the internal architecture of your application more structured and easier to understand then here's something to read and experiment with:

Upvotes: 1

Related Questions