Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building An Application

1,986 views

Published on

Learn how to build a basic applications. Includes a tutorial on building a LinkedIn Application

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Building An Application

  1. 1. Building An Application
  2. 2. OverviewObjectiveLearn how to build a basic applications. Includes a tutorial onbuilding a LinkedIn Application.Requirements Installed version of ProdigyView with a database Understanding of how to install an application Understanding of the DEFINESEstimated Time12 minutes www.prodigyview.com
  3. 3. Follow Along With Code Example1. Download a copy of the example code at www.prodigyview.com/source.2. Install the system in an environment you feel comfortable testing in.3. Proceed to apps/front/HelloWorld/HelloWorld.php www.prodigyview.com
  4. 4. Starts with PV_EXECApplications are called with pv_exec. The application’saccess file will be included and a new instance made.This tutorial is going to start building the application bycreating the access file. The access file is defined wheninstalling the application.If you are unsure of how toinstall an application, read the tutorial on installing anapplication. Singe Point of Entry
  5. 5. Command Interpreter The beginning of our commandInterpreter should look something like this:1. Class Name 2. Constructor(optional) 3. Command Interpreter(required)We simply define the class, a constructor and acommandInterpreter method.
  6. 6. Inside the InterpreterThe required function is the commandInterpreter. It will controlhow your application responds to calls made by the user or otherapplications. Below is the logic for our commandInterpreter inthis example.
  7. 7. Break Down 1. If no command was passed, get the command from $_GET 2.If the command is hijudy or hellojudy, call the method sayHiToJudy() 3. If no command matches, call the main function
  8. 8. Application BodyOutside the commandInterpeter, we have the application bodywith our functions to execute.
  9. 9. Application Body CompleteOur application body should look like this. Next we are going to start executing commands.
  10. 10. Private/Protected FunctionIf you noticed in the body of the application, all themethods were private except for the default method. Oneability of the application is make all the methods private orprotected and only allow access to that applicationthrough the commandInterpreter.This can be considered a form of access control for yourapplication.
  11. 11. Switch DocumentsNow that we have the application built, we can call it.Switch to HelloWorldTest.php to test it out.
  12. 12. Call Our ApplicationMake sure the application is installed first. Then throughpv_exec, we can call the application that was built.1. The application unique id 2. Commands to execute 3. Arguments passed to the application
  13. 13. Automatic CommandInterpeterThere is an easier path to implementing an commandInterpreter. First start by reviewing the tutorial on the chain ofcommand command design pattern. Now we are going toswitch examples and view our LinkedIn application.
  14. 14. Extending PVApplicationJust like in the tutorial on the chain of command designpattern, we are going to extend PVApplication. ThePVApplication will implement the commandInterpreter withoutthe developer having to define it.Using PVApplication, the command will actually become thename of the function to be called.
  15. 15. Application LayoutOur application extending PVApplication then look like this, nocommandInterpreter. All that has to be done is called pv_exec.
  16. 16. Switch DocumentsAgain, switch back to HelloWorldTest.php file and headtowards the bottom of it.
  17. 17. Calling our Application Now execute our LinkedIn application. It will display the share button for LinkedIn.1. Application unique id 2. Command to execute
  18. 18. API ReferenceFor a better understanding of the applications, visit the apiby clicking on the link below.PVApplications More TutorialsFor more tutorials, please visit:http://www.prodigyview.com/tutorials www.prodigyview.com

×