REST back end and ios application to optimize time and recommend new events



Similar documents
DESIGN OF A FACTS DEVICE TO IMPROVE THE IMPORTING CAPACITY FROM MOROCCO

PULSED ELECTROMAGNETIC FIELD DEVICE (PEMF)

DEVICE LOAN PROCESS OPTIMIZATION AND IMPLEMENTATION IN WEB APPLICATION

INTELIGENCIA DE NEGOCIO CON SQL SERVER

Sales Management Main Features

Universidad Pontificia de Comillas

DIPLOMADO DE JAVA - OCA

Present & Future of A400M Services 23/05/2013

AV-002: Professional Web Component Development with Java

FORMACIÓN E-LEARNING DE MICROSOFT

DIPLOMADO EN BASE DE DATOS

How To Know If An Ipod Is Compatible With An Ipo Or Ipo (Sanyo)

ENVIRONMENT: Collaborative Learning Environment

LOS ANGELES UNIFIED SCHOOL DISTRICT REFERENCE GUIDE

ENROLMENT AT THE LYCEE FRANÇAIS DE BARCELONE

ICT education and motivating elderly people

A. Before you read the text, answer the following question: What should a family do before starting to look for a new home?

Exemplar for Internal Achievement Standard. Spanish Level 1

Versión precedente* Lista productos disponibles** Disponible desde el June 1, 2013

Comments on Draft OECD/IOPS Good Practices on Pension Fund s Use of Alternative Investments and Derivatives

Diplomado Certificación

Cambridge IGCSE.

LINIO COLOMBIA. Starting-Up & Leading E-Commerce. Luca Ranaldi, CEO. Pedro Freire, VP Marketing and Business Development

Memorial Health Care System Catholic Health Initiatives Financial Assistance Application Form

ANALYSIS OF CONCENTRATED SOLAR POWER (CSP) DEVELOPMENT IN SPAIN USING FUNCTION OF INNOVATION SYSTEM (FIS) APPROACH

VMware vsphere with Operations Management: Fast Track

When to select APA and other Transfer Pricing options. Challenges and Opportunities for the Maquila Industry Galaz, Yamazaki, Ruiz Urquiza, S.C.

Section 3 Definitions Certification Replace the word acabados with terminados as reference is made to food destined to the end user. Inspection same.

Manejo Basico del Servidor de Aplicaciones WebSphere Application Server 6.0

Por qué ExecuTrain? Por qué ExecuTrain? Modalidad de servicio

EMPLOYER UPDATE New Jersey Department of Labor and Workforce Development

Open-Ended Responses. Parent Survey for schools. Question 1. What do you like best about our school? Response. Survey Open-Ended Responses.

What is the Common Problem that Makes most Biological Databases Hard to Work With, if not Useless to most Biologists?

Home vol.3 - Bathrooms - Scenes & Shapes

New Server Installation. Revisión: 13/10/2014

INFORMATION DOSSIER WORK EXPERIENCE EUROPEAN SCHOOL ALICANTE

New Regulations For Texas Nonsubscribers Effective January 1, 2013

Information Regarding / Información acerca de Unlicensed Money Transmitter / Your Personal Information /

Verbos modales. In this class we look at modal verbs, which can be a tricky feature of English grammar.

Monitoreo de Bases de Datos

CONCEPTS OF INDUSTRIAL AUTOMATION. By: Juan Carlos Mena Adolfo Ortiz Rosas Juan Camilo Acosta

Curso SQL Server 2008 for Developers

LOS ANGELES UNIFIED SCHOOL DISTRICT REFERENCE GUIDE

Resumen de Entrevista: Asociación de Agentes de Aduana del Puerto de Manzanillo

ECCAIRS 5 Instalación

Management effectiveness evaluation: for the CBD and for better parks Principles for MEE Methodologies

Información Importante

Propiedades del esquema del Documento XML de envío:

REVIEWER(S): Clement Anson, Tim Dodge. Ortega Industrial Contractors

Ask your child what he or she is learning to say in Spanish at school. Encourage your child to act as if he or she is your teacher.

OMEGA SOFT WF RISKEVAL

Sympa, un gestor de listas de distribución para las universidades

UNIVERSIDAD TÉCNICA DEL NORTE ARTÍCULO CIENTÍFICO (INGLÉS)

Monitoring, Management and Topological Display Device using wireless network managed clients

NEW TOOLS FOR THE SELECTION OF TECHNOLOGIES; APPLICATION TO SHEET METAL FORMING

Response Area 3 - Community Meeting

Cuánto se demora una pit stop?

CONSENT OF THE GOVERNED EL CONSENTIMIENTO DE LOS GOBERNADOS EXTENDING. Founding Principles for English Language Learners

AP SPANISH LANGUAGE 2011 PRESENTATIONAL WRITING SCORING GUIDELINES

AP SPANISH LANGUAGE 2013 PRESENTATIONAL WRITING SCORING GUIDELINES

Commercial Invoice. Terms and Conditions of Delivery and Payment (incoterms)

What you need TITLE to know about college admission TITLE tests

Guidelines for Designing Web Maps - An Academic Experience

ACTIVITY # Dear Parent, Carta a los Padres. pbskids.org

SUBCHAPTER A. AUTOMOBILE INSURANCE DIVISION 3. MISCELLANEOUS INTERPRETATIONS 28 TAC 5.204

PATIENT'S INFORMATION REGISTRATION SHEET / INFORMACION DEL PACIENTE

0530 SPANISH (FOREIGN LANGUAGE)

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

LOS ANGELES UNIFIED SCHOOL DISTRICT POLICY BULLETIN

LEARNING MASTERS. Explore the Northeast

Entrenamiento a Embajadores Ambassador training

Rodrigo Nicolas Carreras

How To Offset Predictions In Chilean Law

PERSONAL INFORMATION / INFORMACIÓN GENERAL Last Name / Apellido Middle Name / Segundo Nombre Name / Nombre

Impreso de Solicitud / Application Form

Monterey County Behavioral Health Policy and Procedure

Received by NSD/FARA Registration Unit 06/25/2012 3:30:37 PM

Curriculum Reform in Computing in Spain

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

Chapter 12 Intellectual Development from One One to Three to Three

IBM PureSystems: Familia de Sistemas Expertos Integrados

BALANCE DUE 10/25/2007 $ STATEMENT DATE BALANCE DUE $ PLEASE DETACH AND RETURN TOP PORTION WITH YOUR PAYMENT

COSTA DE CANYAMEL - MALLORCA

Modificación de los Gastos operativos y de administración en JPMorgan Investment Funds y JPMorgan Funds

October 08, Re: FORMAL COMPLAINT Spain s Failure to Notify a Draft Technical Regulation Amending the Country s Intellectual Property Law

Advanced Dyer Observers Space Science Camp Application (please list only one camper per form)

Information Regarding / Información acerca de Unlicensed Money Transmitter / Your Personal Information /

Estrategias para la Reducción de Riesgos y Ciber Ataques

GUL-UC3M Jornadas Técnicas

COMPUTACIÓN ORIENTADA A SERVICIOS (PRÁCTICA) Dr. Mauricio Arroqui EXA-UNICEN

LBWN ALQUILAR CON OPCIÓN A COMPRAR

How To Write An Ontology For Control Engineering

Ingeniería de Software & Ciclos de Vida. Luis Carlos Díaz Miguel Torres Julián Rodriguez

Estructura de aplicación en PHP para System i

How to Buy Real Estate in Spain

Request for Reinvestigation Form

Re-broadcasting of bibliographic catalogues in MARC-XML format

AULA EUROPEA DE EMPRESA

Make Your Return-to-Work Process Fit Your Company

ISSAI Control de calidad en una auditoría de estados financieros. Directriz de auditoría financiera

Transcription:

REST back end and ios application to optimize time and recommend new events Autor: Carlos Balduz Bernal Director: David Contreras Bárcena Madrid Junio 2013

AUTORIZACIÓN PARA LA DIGITALIZACIÓN, DEPÓSITO Y DIVULGACIÓN EN ACCESO ABIERTO (RESTRINGIDO) DE DOCUMENTACIÓN 1º. Declaración de la autoría y acreditación de la misma. El autor D. CARLOS BALDUZ BERNAL, como ALUMNO de la UNIVERSIDAD PONTIFICIA COMILLAS (COMILLAS), DECLARA que es el titular de los derechos de propiedad intelectual, objeto de la presente cesión, en relación con la obra Proyecto fin de Carrera: REST back end and ios application to optimize time and recommend new events, que ésta es una obra original, y que ostenta la condición de autor en el sentido que otorga la Ley de Propiedad Intelectual como titular único o cotitular de la obra. En caso de ser cotitular, el autor (firmante) declara asimismo que cuenta con el consentimiento de los restantes titulares para hacer la presente cesión. En caso de previa cesión a terceros de derechos de explotación de la obra, el autor declara que tiene la oportuna autorización de dichos titulares de derechos a los fines de esta cesión o bien que retiene la facultad de ceder estos derechos en la forma prevista en la presente cesión y así lo acredita. 2º. Objeto y fines de la cesión. Con el fin de dar la máxima difusión a la obra citada a través del Repositorio institucional de la Universidad y hacer posible su utilización de forma libre y gratuita ( con las limitaciones que más adelante se detallan) por todos los usuarios del repositorio y del portal e-ciencia, el autor CEDE a la Universidad Pontificia Comillas de forma gratuita y no exclusiva, por el máximo plazo legal y con ámbito universal, los derechos de digitalización, de archivo, de reproducción, de distribución, de comunicación pública, incluido el derecho de puesta a disposición electrónica, tal y como se describen en la Ley de Propiedad Intelectual. El derecho de transformación se cede a los únicos efectos de lo dispuesto en la letra (a) del apartado siguiente. 3º. Condiciones de la cesión. Sin perjuicio de la titularidad de la obra, que sigue correspondiendo a su autor, la cesión de derechos contemplada en esta licencia, el repositorio institucional podrá: (a) Transformarla para adaptarla a cualquier tecnología susceptible de incorporarla a internet; realizar adaptaciones para hacer posible la utilización de la obra en formatos electrónicos, así como incorporar metadatos para realizar el registro de la obra e incorporar marcas de agua o cualquier otro sistema de seguridad o de protección. (b) Reproducirla en un soporte digital para su incorporación a una base de datos electrónica, incluyendo el derecho de reproducir y almacenar la obra en servidores, a los efectos de

garantizar su seguridad, conservación y preservar el formato.. (c) Comunicarla y ponerla a disposición del público a través de un archivo abierto institucional, accesible de modo libre y gratuito a través de internet. 1 (d) Distribuir copias electrónicas de la obra a los usuarios en un soporte digital. 2 4º. Derechos del autor. El autor, en tanto que titular de una obra que cede con carácter no exclusivo a la Universidad por medio de su registro en el Repositorio Institucional tiene derecho a: a) A que la Universidad identifique claramente su nombre como el autor o propietario de los derechos del documento. b) Comunicar y dar publicidad a la obra en la versión que ceda y en otras posteriores a través de cualquier medio. c) Solicitar la retirada de la obra del repositorio por causa justificada. A tal fin deberá ponerse en contacto con el vicerrector/a de investigación (curiarte@rec.upcomillas.es). d) Autorizar expresamente a COMILLAS para, en su caso, realizar los trámites necesarios para la obtención del ISBN. d) Recibir notificación fehaciente de cualquier reclamación que puedan formular terceras personas en relación con la obra y, en particular, de reclamaciones relativas a los derechos de propiedad intelectual sobre ella. 5º. Deberes del autor. El autor se compromete a: a) Garantizar que el compromiso que adquiere mediante el presente escrito no infringe ningún derecho de terceros, ya sean de propiedad industrial, intelectual o cualquier otro. b) Garantizar que el contenido de las obras no atenta contra los derechos al honor, a la intimidad y a la imagen de terceros. c) Asumir toda reclamación o responsabilidad, incluyendo las indemnizaciones por daños, que pudieran ejercitarse contra la Universidad por terceros que vieran infringidos sus derechos e intereses a causa de la cesión. d) Asumir la responsabilidad en el caso de que las instituciones fueran condenadas por infracción de derechos derivada de las obras objeto de la cesión. 1 En el supuesto de que el autor opte por el acceso restringido, este apartado quedaría redactado en los (c) Comunicarla y ponerla a disposición del público a través de un archivo institucional, accesible de modo restringido, en los términos previstos en el Reglamento del Repositorio Institucional 2 En el supuesto de que el autor opte por el acceso restringido, este apartado quedaría eliminado.

6º. Fines y funcionamiento del Repositorio Institucional. La obra se pondrá a disposición de los usuarios para que hagan de ella un uso justo y respetuoso con los derechos del autor, según lo permitido por la legislación aplicable, y con fines de estudio, investigación, o cualquier otro fin lícito. Con dicha finalidad, la Universidad asume los siguientes deberes y se reserva las siguientes facultades: a) Deberes del repositorio Institucional: - La Universidad informará a los usuarios del archivo sobre los usos permitidos, y no garantiza ni asume responsabilidad alguna por otras formas en que los usuarios hagan un uso posterior de las obras no conforme con la legislación vigente. El uso posterior, más allá de la copia privada, requerirá que se cite la fuente y se reconozca la autoría, que no se obtenga beneficio comercial, y que no se realicen obras derivadas. - La Universidad no revisará el contenido de las obras, que en todo caso permanecerá bajo la responsabilidad exclusiva del autor y no estará obligada a ejercitar acciones legales en nombre del autor en el supuesto de infracciones a derechos de propiedad intelectual derivados del depósito y archivo de las obras. El autor renuncia a cualquier reclamación frente a la Universidad por las formas no ajustadas a la legislación vigente en que los usuarios hagan uso de las obras. - La Universidad adoptará las medidas necesarias para la preservación de la obra en un futuro. b) Derechos que se reserva el Repositorio institucional respecto de las obras en él registradas: - retirar la obra, previa notificación al autor, en supuestos suficientemente justificados, o en caso de reclamaciones de terceros. Madrid, a.. de... de. ACEPTA Fdo

Proyecto realizado por el alumno/a: Carlos Balduz Bernal Fdo:.. Fecha: /.. /.. Autorizada la entrega del proyecto cuya información no es confidencial: EL DIRECTOR DEL PROYECTO David Contreras Bárcena Fdo:.. Fecha: /.. /.. V B del Coordinador de Proyectos Israel Alonso Martínez Fdo:.. Fecha: /.. /..

Agradecimientos En primer lugar, me gustaría agradecer a mis padres todo su apoyo y el esfuerzo que ha supuesto para ellos que yo pueda estudiar la carrera que siempre he querido hacer en una de las mejores universidades que hay para dicha carrera. A mis compañeros de clase, por convertirse en una segunda familia durante el transcurso de la carrera y por estar siempre dispuestos a ayudar en cualquier momento, especialmente a Pedro y a David. También quisiera darle las gracias a Linda por estar ahí en lo bueno y en lo malo, animándome en todo momento a dar ese último empujón cuando parecía que el proyecto nunca iba a acabar. Por último, obviamente me gustaría agradecerle a mi director de proyecto, David Contreras, el haberme dirigido y haberme ayudado cuando he tenido algún problema. I

II

REST BACK END Y APLICACIÓN PARA ios PARA OPTIMIZAR TIEMPO Y RECOMENDAR NUEVOS EVENTOS Autor: Balduz Bernal, Carlos Director: Contreras Bárcena, David Entidad Colaboradora: ICAI Universidad Pontificia Comillas. RESUMEN DEL PROYECTO El objetivo de este proyecto de fin de carrera consiste en desarrollar una aplicación para dispositivos ios que ayude a sus usuarios a gestionar su tiempo de una manera más eficiente, y que además aprenda de ellos en base a sus interacciones con la aplicación para poder recomendar nuevos eventos que pudieran resultarles interesantes. Para ello, el proyecto contará con un back end donde se almacenará toda la lógica y se realizarán todas las consultas a la base de datos. Por otro lado, se desarrollará la aplicación para ios, que se comunicará con el servidor a través de la interfaz REST programada en el back end. PALABRAS CLAVE REST, ios, back end, sistema de recomendación, front end. INTRODUCCIÓN En la actualidad, cada vez más personas utilizan de forma activa un smartphone en su día a día. Como consecuencia de ello, cada vez más aplicaciones surgen para satisfacer las necesidades de los usuarios, y se pueden encontrar en la App Store de Apple o en el Market de Android aplicaciones para prácticamente cualquier finalidad. III

Sin embargo, todavía no existe ninguna aplicación que permita a sus usuarios gestionar de una forma eficiente su tiempo libre y que además dicha aplicación vaya tomando información del usuario para poder proponerle eventos o actividades que pudieran resultarle interesantes en base a lo aprendido. Una aplicación así podría mejorar la calidad de vida de los usuarios, y además les permitiría enterarse de novedades o eventos interesantes de los que no habrían sido conscientes si no fuese por la aplicación. Además, una aplicación así también podría incorporar funciones sociales para ser todavía más atractiva para los usuarios, ya que les permitiría comunicarse entre ellos y además crear eventos comunes. Por ello, este proyecto se centra en la creación de una aplicación que pueda servir como agenda electrónica a sus usuarios pero que además aporte el valor añadido de ayudarles a optimizar su tiempo, recomendarles eventos interesantes y poder interactuar con sus amigos. METODOLOGÍA Y DESARROLLO Este proyecto combina una amplia carga teórica con un desarrollo práctico que a su vez se divide en tres partes bien diferenciadas. Puesto que la aplicación para ios desarrollada en el proyecto se conectará a un back end donde se almacenarán todos los datos y donde se procesará la información, es necesario estudiar cuáles son las mejores tecnologías existentes para lograr una comunicación rápida y fiable. Por ello, la primera etapa del proyecto consiste en un estudio exhaustivo de los distintos modos de comunicar un front end y un back end, en especial los servicios web REST, que se están empezando a utilizar cada vez más. Además, durante esta etapa también se han estudiado los distintos frameworks más utilizados en grandes desarrollos de aplicaciones web en Java Enterprise Edition, como Spring Framework y algunos de sus módulos, o como Hibernate. Por último, también ha sido necesario estudiar el lenguaje de programación utilizado para el desarrollo de aplicaciones nativas para ios: Objective-C. IV

Tras adquirir el conocimiento necesario para el desarrollo del proyecto, la segunda etapa estuvo enfocada a la programación del back end y el diseño e implantación de la base de datos donde toda la información será almacenada. Durante esta etapa se utilizaron los frameworks estudiados, como Spring Framework, para disminuir el tiempo de desarrollo gracias a la inyección de dependencias y la programación orientada a aspectos. Además, fue durante esta etapa donde se estudió cómo asegurarse de que el back end se trata de un sistema seguro, puesto que los servicios web de tipo REST presentan mayores complicaciones a la hora de securizar una aplicación. En una tercera etapa del proyecto, se programó la aplicación para ios que los usuarios finales van a utilizar. La aplicación desarrollada se conecta con el back end para cada interacción del usuario con la aplicación, para que toda la información y la lógica de negocio esté centralizada en un mismo lugar. Pantalla principal de Slypter. V

Por último, se ha desarrollado un sistema de recomendación que aprende de los usuarios en función del uso que le dan a la herramienta, pudiendo así en un futuro proponerles actividades que les pudiesen parecer interesantes. CONCLUSIONES Se ha conseguido el desarrollo de una aplicación que permite a sus usuarios organizar sus eventos de una manera más eficiente ayudados por una aplicación informática, y que además es capaz de proponerles nuevos eventos en función de sus gustos. Además, a nivel personal, el proyecto ha servido para adquirir conocimientos en algunos de los frameworks más demandados en el mundo empresarial a día de hoy, en especial Spring Framework. Asímismo, se ha ganado un mayor conocimiento de los servicios web y de las grandes ventajas que aporta REST frente a otras posibles opciones. Por otro lado, se han cumplido los objetivos que se propusieron al inicio de este proyecto, que son el desarrollo de un back end capaz de recibir cualquier petición de la aplicación para ios desarrollada y ofrecer todas las funcionalidades descritas anteriormente. REFERENCIAS [WALL11] Spring in Action. Walls, Craig. Manning. [MCCO04] Code Complete 2. McConnell, Steve. Microsoft Press. [APPL13] Apple s official ios documentation. https://developer.apple.com/devcenter/ios/ VI

[HIBE13] JBoss Hibernate official website. http://www.hibernate.org/ VII

VIII

REST BACK END AND ios APPLICATION TO OPTIMIZE TIME AND RECOMMEND NEW EVENTS Author: Balduz Bernal, Carlos Supervisor: Contreras Bárcena, David Affiliation: ICAI Universidad Pontificia Comillas. ABSTRACT The objective of this final project consists in developing an application for ios devices that helps users manage their time in a more efficient way. Moreover, the application should learn from the users with each interaction, so that the application can recommend new events that the user may find interesting. To accomplish this, a back end has been developed where all the business logic of the system resides and where all the interactions with the database are carried out. As for the front end, an ios application will be programmed that will communicate with the server consuming its REST API. KEYWORDS REST, ios, back end, recommender system, front end. INTRODUCTION Nowadays, more and more people are starting to use smartphones in their daily life. As a result, more and more applications are being developed to satisfy user needs, and millions of applications can be found in Apple s App Store and the Android Market for almost any purpose. However, there are no applications that allow users to manage their free time in an efficient way and that it also stores information from the user to be able to learn IX

about him and recommend new events or activities that the user could find interesting. Such an application could improve the quality of life of its users. Moreover, the application described could also incorporate social features to be even more attractive to users, since it would allow them to communicate between them and to create common events. There, this project focuses on the creation of an application that could be used as an electronic agenda that also helps its users to optimize their time, recommend interesting events and enables them to interact with their friends. METHODOLOGY AND DEVELOPMENT This project is divided into four main stages, being the first one an exhaustive research of the technologies to be used throughout the project. Since the developed ios application will connect to a back end where all the data is stored and where all the information will be processed, it is necessary to study which of the existing technologies would be the best approach. Hence, the first stage of the project consists in the study of the different ways to provide communication between the front end and the back end, specially REST web services. Furthermore, during this first stage several frameworks that are used in the development of large Java Enterprise Edition applications, such as Spring Framework and its modules, or Hibernate. Finally, some research about Apple s official programming language, Objective-C, has also been carried out. After gaining the necessary knowledge to begin with the development process, the second stage of the project focused on the programming of the back end and the design and implantation of the MySQL database where all the data will be stored. During this stage, the frameworks studied in the first stage were used, like Spring Framework, tu reduce development time by taking full advantage of its dependency injection and aspect-oriented programming. As well as this, during this stage several security issues were taken into consideration, deciding how to make the back end secure, since REST web services present some problems with security. X

During the third stage of the project, the ios application that end users wull use was programmed. The developed application connects to the back end with each user interacion, so that all of the data and business logic is centralized in a single location. Slypter s main screen. Finally, a recommender system capable of extracting information from the user has been developed, so that the application can also propose new activities to the user. XI

CONCLUSIONS The development of an application that allows users to organize their events in a more efficient way has been achieved. Moreover, this application is capable of proposing new events to the users depending on what the recommender system has been able to learn from them. Moreover, this project has helped the author gain deeper knowledge about some of the most used frameworks nowadays, such as Spring Framework and Hibernate. Finally, all of the objectives that were originally proposed have been achieved, which were the development of a back end capable of handling any petition from the ios application developed and offer all of the functionalities described earlier. REFERENCES [WALL11] Spring in Action. Walls, Craig. Manning. [MCCO04] Code Complete 2. McConnell, Steve. Microsoft Press. [APPL13] Apple s official ios documentation. https://developer.apple.com/devcenter/ios/ [HIBE13] JBoss Hibernate official website. http://www.hibernate.org/ XII

TABLE OF CONTENTS CHAPTER 1 INTRODUCTION... 1 1.1 PROJECT MOTIVATION... 1 CHAPTER 2 PROJECT SCOPE... 3 2.1 OBJECTIVES... 3 2.2 METHODOLOGY... 5 2.3 PLANIFICATION... 7 2.3.1 Documentation... 7 2.3.2 Back End... 9 2.3.3 Front End... 12 2.3.4 Recommender System... 15 2.4 PROJECT BUDGET... 18 CHAPTER 3 RESTFUL API... 23 3.1 WEB SERVICES... 23 3.2 REST... 24 3.2.1 REST methods for manipulating resources... 25 3.2.2 Response formats... 26 3.2.3 RESTful URLs... 27 3.3 SLYPTER S RESTFUL API... 28 CHAPTER 4 DEVELOPING THE BACK END... 31 4.1 SPRING FRAMEWORK... 31 4.1.1 Dependency Injection... 34 4.1.2 Aspect- Oriented Programming... 35 4.2 SPRING MVC... 36 4.2.1 Spring MVC and REST... 37 4.3 JAVA PERSISTENCE API... 39 XIII

4.3.1 Hibernate... 39 4.4 SENDING NOTIFICATIONS TO AN IOS DEVICE... 41 4.4.1 APNS Java libraries... 44 4.5 SLYPTER S BACK END IMPLEMENTATION... 45 4.5.1 Use cases... 45 4.5.2 Back end architecture... 46 4.5.3 Used frameworks... 48 4.5.4 Conclusions... 49 CHAPTER 5 SECURING THE APPLICATION... 51 5.1 RESTFUL AUTHENTICATION... 51 5.1.1 Authentication Token... 54 5.2 SPRING SECURITY... 55 5.3 SLYPTER S IMPLEMENTATION OF SPRING SECURITY... 56 5.4 SECURE SOCKETS LAYER... 58 5.4.1 Description... 59 5.4.2 How it works... 59 5.4.3 SSL in Slypter... 63 CHAPTER 6 SLYPTER S RECOMMENDER SYSTEM... 65 6.1 RECOMMENDER SYSTEMS... 65 6.2 CONTENT- BASED RECOMMENDER SYSTEMS... 67 6.3 COLLABORATIVE FILTERING... 70 6.3.1 How it works... 70 6.3.2 Gradient Descent... 72 6.3.3 Slypter s Recommendation System... 73 6.3.4 Mean Normalization... 74 CHAPTER 7 IOS FRONT END... 79 7.1 NATIVE OR WEB BASED APPLICATION?... 80 7.1.1 Web Based applications... 80 7.1.2 Native applications... 81 7.1.3 Comparison between both kinds of applications... 82 7.2 RESULTS... 85 XIV

7.2.1 User login... 85 7.2.2 Main screen... 89 7.2.3 Other screens... 91 CHAPTER 8 CONCLUSIONS AND FUTURE DEVELOPMENTS... 95 8.1 CONCLUSIONS... 95 8.1.1 Benefits of Spring... 96 8.1.2 REST... 97 8.2 FUTURE DEVELOPMENTS... 98 REFERENCES... 101 XV

XVI

List of Figures Figure 1. Overview of the project.... 6 Figure 2. First stage of the project.... 8 Figure 3. Second stage of the project.... 11 Figure 4. Third stage of the project.... 14 Figure 5. Fourth stage of the project.... 17 Figure 5. WSDL 2.0 example.... 23 Figure 6. Web service architecture [WIKI01]... 24 Figure 7. RESTless URL.... 28 Figure 8. RESTful URL example.... 28 Figure 9. Overview of the Spring Framework. [SPRI01]... 32 Figure 10. Spring MVC request life cycle. [SMVC11]... 37 Figure 11. Overview of the Hibernate framework. [HIBE13]... 40 Figure 12. ios notifications example.... 42 Figure 13. Device token generation. [APPL13]... 43 Figure 14. Sharing the device token. [APPL13]... 43 Figure 15. Notification message format. [APPL13]... 44 Figure 16. Push notification from a provider to a client application. [APPL13].. 44 Figure 17. Some of Slypter use cases.... 46 Figure 18. Slypter s back end workflow.... 47 Figure 19. Authentication token: user login.... 53 Figure 20. Authentication token: logged user.... 53 Figure 21. Slypter s authentication token example.... 54 XVII

Figure 22. Authenticating a user with a token sequence diagram.... 58 Figure 23. Asymmetric encryption. [MDSN01]... 60 Figure 24. SSL session key negotiation. [SSLA12]... 62 Figure 25. Recommendation systems. [RECO12]... 66 Figure 26. Gradient descent example. [WIKI04]... 72 Figure 27. Comparison between web based and native applications. [SIXR12].. 81 Figure 28. Apple s official IDE: Xcode.... 84 Figure 29. User login sequence diagram.... 87 Figure 30. User login screen 1.... 88 Figure 31. User login screen 2.... 88 Figure 32. Slypter s main screen.... 90 Figure 33. Slypter s main menu.... 91 Figure 34. Adding a new event.... 92 Figure 35. Selecting the time for an event.... 93 XVIII

List of tables Table 1: time estimation for the first stage of the project.... 9 Table 2: time estimation for the second stage of the project.... 12 Table 3: time estimation for the third stage of the project.... 15 Table 4: time estimation for the final stage of the project.... 18 Table 4: detailed project budget.... 20 Table 5: summarized project budget.... 21 Table 6: content-based filtering example.... 67 Table 7: content-based filtering set of features example.... 68 Table 8: mean normalization example.... 75 Table 9: comparison between web based and native ios applications.... 83 XIX

XX

Chapter 1 INTRODUCTION 1.1 PROJECT MOTIVATION Over the last few years, smartphone usage has increased significantly worldwide. More and more people are beginning to use applications to help them in their daily routine. Hence, through application stores such as ios s App Store or Android s Android Market applications of all types can be found for almost any purpose. However, there are still no intelligent agendas that offer something innovative to smartphone users. Some applications focus on allowing its users to introduce their schedule, but none of the existing ones help the user optimize their time. Therefore, this project aims to provide a new application called Slypter for ios users that helps them to organize their time more effectively, allowing them to be more productive. After an initial configuration and using Artificial Intelligence techniques, like for example Artificial Neural Networks, Slypter will learn about the user s behaviour and aid him whenever he needs to make changes to his schedule, proposing the best option according to what the application has learned. As for the personal motivation, several factors were taken into consideration by the author before starting the project: The great challenge of building an ios application that connects to a JavaEE back end with a RESTful API. The possibility of gaining deeper knowledge of some of the most popular Java frameworks: Hibernate and Spring. 1

Learning about recommender systems and how to implement them. Creating an iphone application that can be published in the App Store. 2

Chapter 2 PROJECT SCOPE 2.1 OBJECTIVES The current project consists in the development of an ios application for all iphone and ipod Touch users that may need some help in organizing their daily routine. This application needs to provide the users with something more than just an electronic agenda, it should have something that makes a difference between Slypter and other similar applications. Therefore, the current project will also focus in developing a recommender system that learns from the user with every interaction with the application. This way, the application will use the information stored to propose events in the future that the user may find interesting. To do so, several Artificial Intelligence techniques will be studied to decide which of them are best suited for the application requirements. As well as this, Slypter will allow its users to do much more than just adding events and proposing new events based on their previous decisions. It will also incorporate social features so that users can interact with each other. Every user can add other users to its list of friends, and share events with any of them. Sending messages between users is another thing that Slypter will permit its users to do, as well as inviting friends to a certain event. Hence, this project also aims to create a new social network that is focused on events and helping users to optimize their free time. Moreover, Slypter is made up of two totally independent parts: a website and the ios application to be developed in this project. This project focuses on the latter, the ios application. However, Slypter s website technology uses Java EE servlets, which cannot be used by an ios application. As a result, a new back end 3

has to be developed so that the ios application interacts with it without the need of having to access the website. Furthermore, the API developed in the back end could also be used by the website, avoiding duplicated code and centralising all the business logic in the same place. In conclusion, this project is divided into three main parts, which are the develoment of a front end that targets all iphone and ipod Touch users, the development of a back end that will communicate with the front end, and the study and development of a recommender system that will reside in the developed back end. A list of the main objectives to be satisfied, from a more technical point of view, would be the following: To create a front end application to help users organize their time more effectively. This application will be programmed in Objective-C, which is the main programming language used by Apple for ios. To use Apple Push Notification Service to send notifications to users when there is new data do be presented to the user. To develop a very intuitive and user-friendly Graphical User Interface so that users are encouraged to use the application. To develop a RESTful API in Java Enterprise Edition using Spring Framework and Spring MVC where all the business logic resides. It will be this back end the one that interacts with the database and that decides which information it should return to the client. To add social features such as messaging between users or sending invitations. To secure the developed back end so that unauthorized users cannot use the application or view private information about other users. 4

To study which machine learning techniques would be better to create a recommender system that learns information from the user with every interaction and proposes new events that the user could find interesting. 2.2 METHODOLOGY Due to the nature of this project, a very standard methodology has been used. New software development methods based on iterative and incremental development, such as SCRUM, are not suitable for this project since there are very differentiated stages of the project that need to be concluded before the next one begins. For example, the author of the project knows nothing about Spring Framework, so a first stage of documentation is necessary before starting the development of the back end. For these reasons, this project has been developed following a waterfall model, in which every stage of the project is not initialized until the previous one has been successfully finished. At first glance, the project could be divided into four main stages, each of them focusing in very differentiated parts of the whole system. These four stages are the following: Documentation about Spring Framework and its modules, Hibernate, web services, REST, machine learning and recommender systems. Development of the back end using Java Enterprise Edition, Spring Framework, Spring MVC, Hibernate and Spring Security, creating a RESTful API to be used by the front end. 5

Development of the front end that will consume the REST web services created in the previous stage using Objective-C as the programming language. Creation and development of the recommender system, that will be added as a new module of the back end. These four main stages can be seen in the following figure: Figure 1. Overview of the project. Although the majority of the project will follow a waterfall model, since, for example, the front end cannot be programmed until the RESTful API of the back end is finished, the last three stages will follow a different approach. When developing the back end, the front end and the recommender system, an iterative and incremental development will be used. In every iteration, a new functionality will be planned, implemented and tested. By using this methodology, the development time of each of those three stages may be reduced. Moreover, if an error arises, since each iteration is tested, it will be discovered and solved in the moment, which makes testing easier once the whole project is finished. 6