• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Zazler - the ready-made backend for mobile apps
 

Zazler - the ready-made backend for mobile apps

on

  • 1,133 views

Zazler is a backend for mobile apps that saves developers from having to write server-side code. This allows them to focus on frontend development creating great user experience instead!

Zazler is a backend for mobile apps that saves developers from having to write server-side code. This allows them to focus on frontend development creating great user experience instead!

Statistics

Views

Total Views
1,133
Views on SlideShare
1,078
Embed Views
55

Actions

Likes
2
Downloads
0
Comments
0

5 Embeds 55

http://www.zazler.com 23
http://docs.zazler.net 11
http://nowork.fm 11
http://www.linkedin.com 7
https://www.linkedin.com 3

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Zazler - the ready-made backend for mobile apps Zazler - the ready-made backend for mobile apps Presentation Transcript

    • Zazler Ready-made backend for mobile apps [zăz l r] ʹ ǝ
    • User experience first! The value of an app lies in its user experience, i.e. the result of frontend development. On the other hand, backend development involves many tasks which are often not appreciated by the users. That's what the users perceive as valuable! Many times including tedious, repetitive tasks
    • What is Zazler Zazler is a backend for mobile apps that saves developers from having to write server-side code. This allows them to focus on frontend development. Reducing substantially the time spent on boilerplate backend coding Creating great user experienceto make the app stand out!
    • How Zazler works With our software you can specify a data query as a URL per HTTP request and format the result in a wide array of output types. Puzzled? Check out the next slide Zazler software in a nutshell
    • Data query as a URL SELECT to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date AS kuu, count(*) FROM kohalolek JOIN liige ON liige.id = kohalolek.liige_id WHERE kohal IS TRUE AND liige_id = 13979 GROUP BY to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date ORDER BY to_char(date_trunc('month', aeg), 'YYYY-MM-01')::date; With Zazler you can take a database query like this: … and instead present it as a URL like this: http://dev.zazler.eu/data/riigikogu/kohalolek.html? join[liige]=liige.id=liige_id&where=kohal=1:liige_id=L&select=month(aeg)@kuu, count(1)&group=month(aeg)&limit=20&L=13979&order=month(aeg) SQL URL
    • Zazler architecture Zazler (in the dashed box) parses the URL, compiles the query into a respective SQL and adds privileges. It also presents the output data in the required format. Privileges Database Client applications HTTP Format adapters URL parser
    • Back-end examples <? mysql_connect("localhost", "root", "foo") or die("Could not connect: " . mysql_error()); mysql_select_db("tutorial"); $task = ''; if ( isset($_GET ['task'])) { $task = $_GET ['task']; } if ( isset($_POST['task'])) { $task = $_POST['task']; } switch($task){ case "LISTING": // Give the entire list getList(); break; default: echo "{failure:true}"; // Simple 1-dim JSON array to tell Ext the request failed. break; } function getList() { // $query = "SELECT * FROM presidents pr, parties pa WHERE pr.IDparty = pa.IDparty"; TODO $query = "SELECT * FROM presidents pr"; $result = mysql_query($query); $nbrows = mysql_num_rows($result); if($nbrows>0){ while($rec = mysql_fetch_array($result)){ // render the right date format $rec['tookoffice']=codeDate($rec['tookoffice']); $rec['leftoffice']=codeDate($rec['leftoffice']); $arr[] = $rec; } echo '({"total":"'.$nbrows.'","results":'.json_encode($arr).'})'; } else { echo '({"total":"0", "results":""})'; } } // Encodes a YYYY-MM-DD into a MM-DD-YYYY string function codeDate ($date) { $tab = explode ("-", $date); $r = $tab[1]."/".$tab[2]."/".$tab[0]; return $r; } http://v1.zazler.eu/tutorial/listing.grid1.ext.html?select=firstname,lastname package com.loiane.web; @Controller public class ContactController { private ContactService contactService; @RequestMapping(value="/contact/view.action") public @ResponseBody Map<String,? extends Object> view() throws Exception { try{ List<Contact> contacts = contactService.getContactList(); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error retrieving Contacts from database."); } } @RequestMapping(value="/contact/create.action") public @ResponseBody Map<String,? extends Object> create(@RequestParam Object data) throws Exception { try{ List<Contact> contacts = contactService.create(data); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error trying to create contact."); } } @RequestMapping(value="/contact/update.action") public @ResponseBody Map<String,? extends Object> update(@RequestParam Object data) throws Exception { try{ List<Contact> contacts = contactService.update(data); return getMap(contacts); } catch (Exception e) { return getModelMapError("Error trying to update contact."); } } @RequestMapping(value="/contact/delete.action") public @ResponseBody Map<String,? extends Object> delete(@RequestParam Object data) throws Exception { try{ contactService.delete(data); Map<String,Object> modelMap = new HashMap<String,Object>(3); modelMap.put("success", true); return modelMap; } catch (Exception e) { return getModelMapError("Error trying to delete contact."); } } private Map<String,Object> getMap(List<Contact> contacts){ Map<String,Object> modelMap = new HashMap<String,Object>(3); modelMap.put("total", contacts.size()); modelMap.put("data", contacts); modelMap.put("success", true); return modelMap; } private Map<String,Object> getModelMapError(String msg){ Map<String,Object> modelMap = new HashMap<String,Object>(2); modelMap.put("message", msg); modelMap.put("success", false); return modelMap; } @Autowired public void setContactService(ContactService contactService) { this.contactService = contactService; } } PHP Java URL So instead of writing this in backend You just write this in frontend
    • Front-end embed code Reading and writing the data to and from a database is possible by using the following code example: /* Getting data from table */ function getData() { var url = 'http://www.example.com/db/table.json'; var get = new XMLHttpRequest(); get.open('GET', url, false); get.send(); return JSON.parse(get.responseText); } console.dir(getData()); /* Putting data to table */ function putData(data) { var send = new XMLHttpRequest(); send.open('POST', 'http://www.example.com/db/table.json', false); send.send(JSON.stringify(data)); return (send.status == 200); } console.dir(putData([{id:1,name:"Jim"}])); JavaScript
    • Features of Zazler Functions: RESTful APIs of SQL databases Configurable access rights (HTTP authentication) CRUD functionality Readily available formats: JSONArray, JSONObject, HTML, ASCII Other properties: One interface for databases: MySQL, PostgreSQL Intuitive syntax Possibility of inline solutions Rapid prototyping Implementable with an existing information system Creating mash-ups Zazler documentation and examples: http://docs.zazler.net
    • Contact us info@zazler.eu +372 52 861 52 rudolfosman Want to try Zazler out in your project? Have comments or questions regarding Zazler? Just drop us an e-mail!