Last post Feb 25, 2010 10:00 AM by hans_v
Feb 25, 2010 05:30 AM|786_CodeWarrior|LINK
A classic scenario for you to ponder over and feedback to me (please).
I have been requsted to create a website. So far so good.
But the site will have a total of 1 (ONE) page only.
The page itself will only contain a form that users will submit.
1 - Register the details in the form into a single database table
2 - Send an email out to the customer and form admin to process
I am thinking 2 ways of doing this:
Plan A - Create the usual asp.net website with only one page saving directly onto database table.
Plan A is overkill just for a single page.
Plan B is better for scalability so I can add other public functions to the WCF service over time.
Your views much appriciated.
Feb 25, 2010 08:52 AM|Careed|LINK
I have used your Plan A on several occasions. It's not overkill because a web application only needs one page. In some cases, you have a single ASPX file (with code-behind), but your functionality is in a series of class files contained in your App_Code
In this instance, you could do something along those lines where you could create a class for saving the data by passing the input from your form to it as an array, list, or DataSet, and you could have another class that handles the email process. This
will leave your code-behind fairly clean and could serve as a basis for creating a class library that could be used by another simple application such as this one (allowing for scalability as you indicated with Plan B).
Regardless, I do not see any real difference between Plan A and Plan B in execution and reusability, except that you lose some flexibility with the HTML file.
Just my opinion....
Feb 25, 2010 09:27 AM|toas1|LINK
I agree with careed. Any off your plans would do the job but personally I would go for plan A. Why? Dont make it harder then it need to be.
I bet it must have taken you longer time to write this question then to actually create your website If something is that
simple I always go for the easiest solution, you can always change in the future if you need to.
Feb 25, 2010 10:00 AM|hans_v|LINK
Plan B is better for scalability
Yeah, Scalability is a major concern, because you might end up with perhaps 3 instead of 1 page, an increase of 200%.
You might consider an n-layered architecture also, so you can reuse your code easily. Also use a webfarm, because one server might crash when you scale up