Reputation: 6989
I m somewhat okay with why & where Smarty is used and also the upper hand it has over traditional PHP... but please tell me how is the separation of the application and the presentation parts needed as the definition itself says this about Smarty.. Please suggest some web sites where i can get some details in simple literature.......
Upvotes: 0
Views: 220
Reputation: 67157
Most programming models try at least to separate “business logic” (application logic) and “presentation”. Actually, many architectures define even more separate “layers” or “tiers”.
Business logic is what your program is about, what you are trying to achieve. For example, if you are writing a guestbook application, handling users and comments is part of the business logic.
Presentation means presenting the data managed by the business logic to your users by some kind of user interface. When using Smarty, this will usually mean creating HTML.
Separating these layers has many advantages:
For more details, look for terms like “MVC” (Model-View-Controller) or “Multitier architecture”.
Especially useful might be the description of the “three-tier architecture” in the latter Wikipedia article. In addition to presentation and application tiers, it defines the “data tier” that is responsible for storing and retrieving persistent data.
Upvotes: 3