StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Object Orientation in PHP - Case Study Example

Cite this document
Summary
From the paper "Object Orientation in PHP" it is clear that generally, the lifeline of an object extends from the object’s rectangle using the dotted lines. It indicates the change of time. The order of the progression of actions is from the top to the bottom…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER91.1% of users find it useful
Object Orientation in PHP
Read Text Preview

Extract of sample "Object Orientation in PHP"

Object Orientation in PHP Insert Insert Object-orientation enables modular design by associating data with the functions that act onthe data, and provides significant support for both code and functionality reuse. Critically discuss the above statement using PHP examples to illustrate your arguments. In modular design, a system is divided into single smaller units called modules. Each module can be developed independently and used in varied applications. These are consequent as reusable. The essence of using modules is better to understand the system as to maintain and extend it. By having coherent modules, encapsulate the behavior and only show it via interfaces, change to details on how the module is implemented (Ullman, 2013). As a result, to extend novel modules that have different implementations can be established even without making changes to the existing modules. Modules should not be too thick so that reusing it becomes a bigger problem. In addition, they should not be extremely light as to offer very little value. Thus, it is vital for any design to put into consideration the weight of the module in concern. To attain a good module, it is necessary to reduce the number of dependencies as we aim and achieving the most out its capacity to be reused. In modularity, when one module fails the others do not fail. Through this, it is easier to control composite systems that are codependent. The principles employed include modular composability, decomposability, understandability, continuity, and protection. The latter case concerns that something out of the ordinary happening is to the concerned module. It does not affect other modules. Decomposing on the other hand concerns with breaking a software maniac into sub-smaller problems that can be linked through an independed framework allowing each to be worked on separately. To be understandable means a human being can read and comprehend the functionality of that module without relating to the other modules. Continuity conforms to the idea of a problem remaining or affecting the module that is. When it comes to what the software is off, different modules developed in various environments are integrated into novel systems. In PHP, a framework provides the starting point to build modular systems. Most of the structures already existing have the capability of breaking up the application and organizing the files. Some like Symfony2 are based on models that rely on injection. It is excellent for modularity (Powers, 2008). To perform best at adding, and removing components, a better framework would be to use Alloy or Kohana. Some extensive frameworks like Zend and CodeIgniter tend to implement modular classes whereas MVC has a well-established modular design. When developing a website that requires you to integrate payment methods, for instance, a shopping cart, you need a class that has all the functions. Also, have a class that extends the base class. Then, individual payment system wills for example Skrill will the base class that has payments and allows you to load all the .php files. During the selection of a payment option, you do not load an individual dossier; instead, create an object of that instance. What is required now is to call the resultant case? Forexampleiftheinstancewasyouhavecallitusingthefollowingstatementonlyclasspublicfunctionsdefinedtheoneis Alternatively, after establishing the base class, then you can create an object of the payment means. In that case, the base class determines what file is. In this scenario, it is wise to have a function to load the data since not all the companies with the different means of payment have similar frameworks to submit it. It, therefore, means that there should be a general way to synchronize the vendors structure with what is in your system. Necessary functions include one to submit data to the provider companies for processing and one to analyze feedback and standardize it to your structure. Thus, there will be only one method required to call all the above three functions i.e. load -> submit ->relateFeedback Code reuse happens when a section of a code has its functionality being used somewhere else without its repetition. When this block of code is, then the entire functionality of that system in all of its instances is changed. Although object-oriented programming supports both code and functionality reuse, it is not the only way reuse can be. Other languages that are based on functional programming used pattern matching and recursion to achieve reuse. Other sites like Google use high order functions like map and folder to achieve code reuse. OOP supports code reusability and functionality reusability in many ways. One of the ways is inheritance (Li et al., 2011). When we reuse code in a hierarchical manner, the general features of the general are applied to the particular automatically. For example to create the physical property of a child, we only need to refer to the physical properties of a human being without having to recode it. The two main types of relationships advanced by reuse is the is-a relationship and has-a relationship. In is-a relationship, a human being is an improved instance of an animal. On the other hand, has a relationship a human being has features that an animal has. Code reuse and functionality is in OOP with polymorphism. Polymorphism is a concept that surrounds the idea of an entity, for example, a process of doing something or a variable being used to work on values of varied kinds when the program runs. As a result, polymorphism is usable in different programs with little or no change to the original code by its developer (Rodríguez and Acuña, 2013). In due course, the term was coined to mean write once and run many times. However, despite all of these ways of code reuse in OOP and its benefits, code has many assumptions that should be when using code reuse. The Unified Modeling Language (UML) provides several diagrams for modeling object-oriented (OO) systems. Describe how class diagrams model the class structure of a system. Provide illustrative examples. Class diagrams are important in mapping the structural relationships of the parts of a particular system. It outlines the system and the components it contains. To identify the classes making up a system, it is vital to examine the nouns and noun phrases contained in the document specifying the requirements of that system. Any object-oriented system uses classes as its primary building blocks. They represent a still nature of a section of the model or the entire model. It majorly designates the behaviors and attributes of the specific class (Weilkiens and Oestereich, 2007). They are very hand in mapping the relation of interfaces and categories. Class diagrams can also be used to show inheritance, connections and composition with aggregations. It also employs generalizations and associations. Individual classes in a class diagram are as a rectangle that has three partitions. The bottom section has the operations of the class whereas the center section contains the attributes. The attributes refer to the fields in the class while the services refer to the methods in the category. Further, the upper compartment holds the name of the class. An example is in figure 1.0 below: For example to model an ATM system the following class diagram is. Figure 1. A class diagram for the ATM system. The above ATM network structure represents a number of relationships. For instance, there is a one-to-one relationship between the BankDatabase and the ATM. There is a one to many relationships between the Account and the BankDatabase. From the above diagram, the solid diamonds show a composition relationship. The ATM is on the CashDispenser, the Screen, DepositSlot, and Keypad. When the composition relationship is weak, hollow diamonds are used at the end of the association. Such a relation is termed as being an aggregation. Sometimes it is a good idea to name the associations in the class diagram. For instance, contains maps the relationship between the BankDatabase and the Account i.e. the BankDatabase provides an Account. 1. Describe how sequence diagrams model the interaction between objects of a system. Provides illustrative examples. Sequence diagrams represent how objects interact with a system. They mainly emphasize the interactions occurring in a system. In a financial scenario, the sequence diagram shows the order that the interactions occur (Weilkiens and Oestereich, 2007). For example in the ATM system above, before cash is, the user is shown an alert to enter the amount they wish to withdraw. These diagrams simplify the depiction of associations. For example, the diagram below represents the order of interactions that occur when a withdrawal from an ATM occurs. Figure 2. A sequence diagram for ATM withdrawal The lifeline of an object extends from the object’s rectangle using the dotted lines. It indicates the change of time. The order of progression of actions is from the top to the bottom. Thus, the action that is closer to the top occurs earlier than the one occurring at the bottom. A message between two objects is by an arrowhead moving from the sending object to the receiving object. For instance, the first message in the above diagram is from the withdrawal to the screen. The thin vertical rectangle in the diagram shows that an object is executing. A dotted line from the receiver to the sending object displays a return message. UML allows us to omit the return message arrows to do away with untidiness. As a result, the diagrams are better readable than if they were included. It is also in order to display parameters in the message (Zandstra, 2014).The name of the message appears e.g. in the above diagram, debit (amount) appears between the objects BankAccount and Account. The sequence of messages in the above diagram is below First, the Withdrawal makes a request to the user to select an amount to withdraw by sending a message to the screen. Next, the Keypad to receive a message from Withdrawal for the user to enter an input value. Thirdly, the BankDatabase will receive a message from the Withdrawal to check the available balance. The BankDatabase will then send the Account a message to show the amount of the available balance. The Withdrawal then sends a message to the CashDispenser to check if there is sufficient cash. If there is, a debit message is sent to the BankDatabase, and the amount similarly is debit to the account. A message to release the cash is sent to the CashDispenser. A message then appears on the screen directing the user to collect the cash. List of References Li, Q., Yao, M., Wang, W. and Du, Y. (2011). Code Reuse in Gene Expression Programming. AMM, 50-51, pp.13-17. Powers, D. (2008). PHP object-oriented solutions. Berkeley, Calif.: Friends of ED, an Apress company. Rodríguez, F. and Acuña, S. (2013). Reuse of a Usability Functionality Implementation in Web Applications. Procedia Technology, 9, pp.236-246. Ullman, L. (2013). PHP advanced and object-oriented programming. Berkeley, Calif.: Peachpit. Weilkiens, T. and Oestereich, B. (2007). UML 2 certification guide. Amsterdam: Elsevier/Morgan Kaufmann. Zandstra, M. (2014). PHP Objects, Patterns, and Practice. Dordrecht: Springer. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(“Object-orientation , The Unified Modelling Language (UML) Essay”, n.d.)
Object-orientation , The Unified Modelling Language (UML) Essay. Retrieved from https://studentshare.org/information-technology/1682759-object-orientation-the-unified-modelling-language-uml
(Object-Orientation , The Unified Modelling Language (UML) Essay)
Object-Orientation , The Unified Modelling Language (UML) Essay. https://studentshare.org/information-technology/1682759-object-orientation-the-unified-modelling-language-uml.
“Object-Orientation , The Unified Modelling Language (UML) Essay”, n.d. https://studentshare.org/information-technology/1682759-object-orientation-the-unified-modelling-language-uml.
  • Cited: 0 times

CHECK THESE SAMPLES OF Object Orientation in PHP

Classes and Class Hierarchies in C++

hellip; object instantiation is the creation of an object, that is, the realization of a specific item of a class.... It means that in C++ being an object-Oriented Program objects communicate with one another using the public function declaration as to the interface.... In C++, object-oriented oriented compilers, inga exitance is concept thigh-level high level class (the parent class field) with a low level class (the child class field) (Bronson, 2011)....
9 Pages (2250 words) Essay

Intelligence: More than Genes or Exposure

Heredity has long been credited with the transfer of traits specifically physical attributes and even abstract concepts such as personality, aggression, sexual orientation and intelligence.... To get what she likes, she would forcibly stomp her feet in successive manner to emphasize her communication until the object of desire was given to her.... To get what she likes, she would forcibly stomp her feet in successive manner to emphasize her communication until the object of desire was given to her....
2 Pages (500 words) Case Study

The Ultimate Program for Gifted Learners

When a child is born he brings with him a set of new thoughts, ideas and talents.... It is a grand and invigorating experience.... He is a gift of God not only to the parents but to the entire neighborhood.... A bundle of joy, he is a source of boundless amusement in the family and the neighborhood who shower him with love and affection. … The years roll, the child grows to be a youth and then an adult....
10 Pages (2500 words) Essay

Zend is IGN Entertainments Next Generation Platform

This essay, Zend is IGN Entertainment's Next Generation Platform, stresses that Zend Framework has already been adopted by many fledgling as well as formidable institutions to aid them in devising better php application.... php 5 was not new to Right Media; in fact, it had initially employed it in its operations as early as 2004 during the creation of the web application as it had already been the standard in the industry....
10 Pages (2500 words) Essay

The Impact of the Internet

The present study aims to make an in-depth investigation into the impact of internet on the everyday life of the individuals, by paying special heed to the subjects of love, sex and dating.... One of the most essential reasons behind carrying out the research on the above-stated… ic includes the significant increase in the application and popularity of internet in all parts and regions of the globe without discrimination during the modern era, which not only has turned communication process to be easier and faster one in comparison to the past, but also Consequently, the present research contains profound sociological significance in its nature and scope....
7 Pages (1750 words) Essay

Web Application Development

This coursework "Web Application Development" describes features of the model view controller and responsive Web design.... This paper outlines the benefits and limitations of MVC, the use of CSS Media Query instead of JavaScript-driven solutions, Flexible Font Units, adaptive images.... hellip; It is also comprised of a view that gives data representation output as graphs, diagram, or charts....
8 Pages (2000 words) Coursework

Web Development for Business

The object-oriented or object orientation method in comparison to the traditional technique is highly different, which centered on the functions and procedures of the system.... In the context of designing the environment based on object orientation, the software is a collection of separate and distinguished objects, which summarizes its data and functionality to reflect the real scenario objects.... The term object-orientation is generally described as a process, which combines various objects in order to provide and perform meaningful action depending on the object that the user wants to manipulate....
12 Pages (3000 words) Coursework

IT Application Development

… IntroductionIn many organizations or business enterprises today, there are existences of increased stand-alone application systems that are used for day-to-day running of business operations.... Stand-alone applications however have increase IntroductionIn many organizations or business enterprises today, there are existences of increased stand-alone application systems that are used for day-to-day running of business operations....
7 Pages (1750 words) Assignment
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us