Separating the Layers Now that we have a
Separating the Layers Now that we have a good idea about multi-tier development, it’s time to see how we can achieve it. Basically the task is to separate the identified layers in your application and minimize the interaction between them. Why? Because when you change a layer, the changes reflected to the other layers are proportional to the level of contact between the layers. If the layers are very strongly coupled, changing a layer would usually imply changing the other too. Since changing layers implies programming, we want to minimize the number of hours/lines of coding we need when we change a system. This is a really practical definition of software maintainability. To separate the layers abstractions must be built. Each layer must have a programming abstraction representing it: object-oriented programming, design patterns, and a careful design are the best tools to achieve this task. Minimizing the interaction between layers becomes a must if performance and flexibility over scale are to be retained. A multi-tiered development process should have at least the following goals: . Maintainability . Modular programming . Independence between logic and presentation . Independence between logic and content . Portability . Database independence . Code reusability We will discuss some of the above topics below. Modular Programming Modular programming is important, as you cannot easily separate the different layers we have identified without programming in a highly modular way. Modular programming will lead to isolated and encapsulated modules for each logic element in the system. OOP is the best method to increase modularity in PHP code, as it promotes unit and integration testing, the use of XP methodology, the use of design patterns with OO, and reusability. Also, you should stress code reusability. If you achieve this goal, software will be easier to maintain and you will be able to code less in future applications. Independence between Logic and Presentation Separating logic and presentation is the key to highly maintainable software. The idea is simple if the designers intend to change the presentation of the site, no logic should be modified, and if the editors change the content, no change should be reflected in the logic of an application. Independence between Logic and Content If the editors change the content no change should be seen in the logic of the application. Database Independence If you use a database you don’t have to depend on the database; it must be easy to change the DBMS being used without changing the logic layer of the application. Page 537
Note: If you are looking for cheap and quality provider to host and run your java application check Astra java hosting services