473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Planning Web Applications

I am wondering what is the best way to develop a web application.

I am currently learning PHP and javascript at the moment.

I have been looking around and I have come across a layered method of application. Where there are 3 layers. User layer or layer that the user interacts with. The business where all the processing is done and finally the database layer where the application connects to all the information in the site.

So when you experts have a large project to do, would you break up your task into smaller tasks and into layers for different functions.

Also would most of you use classes when using this application model as they are reusable and easy to implement.
Aug 3 '07 #1
4 1470
I am wondering what is the best way to develop a web application.

So when you experts have a large project to do, would you break up your task into smaller tasks and into layers for different functions.

Also would most of you use classes when using this application model as they are reusable and easy to implement.
If you are building a small application, you can get away with one/two tiers, i.e. the presentation layer, and the data layer. It's not best practice, but can be useful for an intranet application. However, you will be limiting future extensibility and ease of maintenance.

The n-tier (where typically n = 3) is a time-tested and valid way to develop web applications. The bottom tier, or data layer, would be your database, and the middle tier would be your business layer. Your classes would reside in the middle tier, and would handle all communication with the data layer. The presentation layer is the top tier, and handles all user interfaces, and communicates only with the middle tier. By abstracting the tiers this way, it becomes easy to drop in a new presentation layer - for say, mobile devices, IVR, etc.

A common way of doing this these days is to use a model-view-controller framework, especially in PHP (as I see it anyway, being a newbie to PHP). Your views are the presentation layer, and your models are the business layer (roughly).

And yes, you are right - this way leads to better reuse.

-Jay
Aug 3 '07 #2
kovik
1,044 Expert 1GB
Re-usability is all about flexibility. When you write your application, if you want it to be re-usable, you'll need to think in terms of what else your classes could be used for. The beauty of OOP is that you can extend multiple classes from another class, giving them all the same functionality, plus some. You'll want to build a framework that can be extended to fit any of your projects.

As Jay mentioned, the MVC is a very good layered application format. Model-View-Controller basically means that you have the program, then the display, and then the user input.

The Controller is the user input, as everything that your application does is in response to a user action. The controller takes the input and turns it into a request, and serves data based on that request. The View is the actual display. The hardest part of a pure MVC format is making the View it's own element, as so many PHP programmers are accustomed to procedural programming and inserting <?php tags into HTML documents. The best way (that I've found) to separate View from the rest is with templates (though I've written my own template engine as the others were too robust). Finally, the Model is the meat of the program. The model is every module that your program includes. From an internal search engine to a navigation menu, each module handles itself.


The way the application flow operates is that the controller takes user input and deciphers the request. It gathers up all necessary modules based on the request, thus forming the model. Then, it loads the model into the view which inserts the modules into the template. Then, the final product is displayed on-screen. Ideally, you'll only need one call to echo/print in per page request.
Aug 4 '07 #3
Thank you for you replies. It may seem straight forward to you, it probably is not too difficult to implement but for a better understanding I think I would need examples. Do you know where I can get examples (easy to understand examples) of such a model.

Also I only at the beginning of my OOP learning experience and I am only starting to understand the power and ease of use classes are.

So if you could help me thanks
Aug 5 '07 #4
kovik
1,044 Expert 1GB
Thank you for you replies. It may seem straight forward to you, it probably is not too difficult to implement but for a better understanding I think I would need examples. Do you know where I can get examples (easy to understand examples) of such a model.

Also I only at the beginning of my OOP learning experience and I am only starting to understand the power and ease of use classes are.

So if you could help me thanks
Well, following design patterns such as these pretty much require OOP. The 'layers' must communicate with one another, somehow.

If you're new to OOP, tackling something like a framework is not recommended, as even if you do complete it, you'll likely end up having to completely rewrite it, which is no fun. What you'll want to do is create something basic, and slowly break it down into objects to understand how they must communicate and handle the separation of duties.
Aug 5 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Logu | last post by:
Hi Any Ideas and Inputs on Cost Estimation/Planning stage of .NET Projects, i.e. things like Function point Analysis, COCOMO and on full planning stages etc etc. Any Frameworks, feasible...
0
by: Jason Sirota | last post by:
I am an advanced database and vb programmer but recently my position has called for advanced archtecture descisions enterprise-wide. Although I have quite a bit of knowledge on designing relational...
2
by: Gary | last post by:
Hello, Does anyone have any recommendations of any articles on the internet with guidelines on the best ways to plan a .NET development project? Regards, Gary
2
by: Koen | last post by:
Hi all, Is there any example code available somewhere that graphical visualizes a simple network planning (PERT chart)? I have two tables: tblAction: ActionID (PK) Description
1
by: jc | last post by:
I must create an application with Access 2003 which generate a fabrication planning i don't know how i can sort cells because i have different parameter has to take into account. do you know...
0
by: Abhishek Srivastava | last post by:
Hello All, Is there any book or any technical article on the web which teaches how to do capacity planning for .net applications? regards, Abhishek.
0
by: Yoxel.Com | last post by:
Release Planning System" at Yoxel.Com allows software development teams to: - collaboratively create a release plan based on deadline, effort estimates and priorities. - track implementation...
2
by: Logu Krishnan | last post by:
Hi, I'm looking out info on how to perform System Sizing and Capacity Planning for a product built using ASP.NET... is there any specifics ? any pointers to these will be highly appreciated. ...
5
by: Ronald S. Cook | last post by:
I've read a few posts on the stored procedure vs dynamic sql debate. I ran a few performance test for myself and it appears to be a wash. Given that, I'm leaning toward dynamic sql mostly...
0
by: Joseph Ferris | last post by:
Good afternoon, I understand the basic theories of capacity planning as it relates to profiling an existing web site, such as in the examples given in the MSDN Article, "How To: Perform Capacity...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.