In this Java Spring Training session, you will learn Spring – Inversion of Control, Dependency Injection and Bean definitions. Topics covered in this session are:
For more information, visit this link:
Spring Framework
• Core Container
• Data Access/Integration
• Web Layer
• Spring Setup
• Key features
• Spring Bean
• Dependency Injection
• Relation between DI and IoC
• Spring IoC Containers
• Spring DI
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Nowadays traditional layered monolithic architecture in Java world is not so popular as 5-10 years ago. I remember how we wrote tons of code for each layer repeating almost the same parts for every application. Add unit and integration testing to understand how much time and efforts has been spent on repeatable work. All cool ideas around DDD (domain driven design) and Hexagonal Architecture was just a nice theory because reality hasn’t allow us to implement it easily. Even Dependency Injection with Spring framework was completely focused on traditional layered approach, not even talking about JavaEE platform.
Today we have Spring Boot ecosystem covering most of our needs for integration with almost all possible technologies and microservices architectural trend, enabling completely new approach to build Java applications around domain model. It is so natural to build Java domain-oriented services and connect them with external world using ports and adapters, that Hexagonal Architecture is almost enabled by default. You just need to switch your way of thinking…
In this Java Spring Training session, you will learn Spring – Inversion of Control, Dependency Injection and Bean definitions. Topics covered in this session are:
For more information, visit this link:
Spring Framework
• Core Container
• Data Access/Integration
• Web Layer
• Spring Setup
• Key features
• Spring Bean
• Dependency Injection
• Relation between DI and IoC
• Spring IoC Containers
• Spring DI
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Nowadays traditional layered monolithic architecture in Java world is not so popular as 5-10 years ago. I remember how we wrote tons of code for each layer repeating almost the same parts for every application. Add unit and integration testing to understand how much time and efforts has been spent on repeatable work. All cool ideas around DDD (domain driven design) and Hexagonal Architecture was just a nice theory because reality hasn’t allow us to implement it easily. Even Dependency Injection with Spring framework was completely focused on traditional layered approach, not even talking about JavaEE platform.
Today we have Spring Boot ecosystem covering most of our needs for integration with almost all possible technologies and microservices architectural trend, enabling completely new approach to build Java applications around domain model. It is so natural to build Java domain-oriented services and connect them with external world using ports and adapters, that Hexagonal Architecture is almost enabled by default. You just need to switch your way of thinking…
These are the slides of my "Fake it Outside-In TDD" session at the #XP2017 conference. Do not miss to check out the referenced screencasts that illustrate the approach very well: https://www.youtube.com/playlist?list=PL_ueet93U84VIy8O7U4dUV0GyGvuzFAt8
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Testing API platform with Behat BDD testsStefan Adolf
An addon talk for the api platform talk that goes into the depth of BDD support in api platform. Use Behat to write human readable feature and scenario descriptions. Accompanying demo repo for the basic behat test cases: https://github.com/coding-berlin/great-countries
Spring MVC 3.0 Framework
Objective:
1. Introduce Spring MVC Module
2. Learn about Spring MVC Components (Dispatcher, Handler mapping, Controller, View Resolver, View)
Slides:
1. What Is Spring?
2. Why use Spring?
3. By the way, just what is MVC?
4. MVC Architecture
5. Spring MVC Architecture
7. Spring MVC Components
8. DispatcherServlet
9. DispatcherServlet Architecture.........
.........................................................
Transactions and Concurrency Control PatternsJ On The Beach
Transactions and Concurrency Control Patterns by Vlad Mihalcea
Transactions and Concurrency Control are very of paramount importance when it comes to enterprise systems data integrity. However, this topic is very tough since you have to understand the inner workings of the database system, its concurrency control design choices (e.g. 2PL, MVCC), transaction isolation levels and locking schemes.
In this presentation, I’m going to explain what data anomalies can happen depending on the transaction isolation level, with references to Oracle, SQL Server, PostgreSQL, and MySQL.
I will also demonstrate that database transactions are not enough, especially for multi-request web flows. For this reason, I’m going to present multiple application-level transaction patterns based on both optimistic and pessimistic locking mechanisms.
Last, I’m going to talk about Concurrency Control strategies used in the Hibernate second-level caching mechanism, which can boost performance without compromising strong consistency.
Web services tutorial slides from my session at DPC 2012 in Amsterdam. In this 3-hour session we built the simplest possible service, and then extended it, looking at RPC, REST and SOAP along the way.
These are the slides of my "Fake it Outside-In TDD" session at the #XP2017 conference. Do not miss to check out the referenced screencasts that illustrate the approach very well: https://www.youtube.com/playlist?list=PL_ueet93U84VIy8O7U4dUV0GyGvuzFAt8
Les slides de ma présentation à Devoxx France 2017.
Introduite en Java 8, l'API Collector vit dans l'ombre de l'API Stream, ce qui est logique puisqu'un collecteur doit se connecter à un stream pour fonctionner. Le JDK est organisé de sorte que l'on utilise surtout les collectors sur étagère : groupingBy, counting et quelques autres. Ces deux éléments masquent non seulement le modèle de traitement de données des collectors, mais aussi sa puissance et ses performances.
Ces présentation parle des collectors qui existent et qu'il faut connaître, ceux que l'on peut créer, ceux dont on se doute que l'on peut les créer une fois que l'on comprend un peu les choses, et les autres, tant les possibilités offertes par cette API sont illimitées.
This talk introduces Spring's REST stack - Spring MVC, Spring HATEOAS, Spring Data REST, Spring Security OAuth and Spring Social - while refining an API to move higher up the Richardson maturity model
Testing API platform with Behat BDD testsStefan Adolf
An addon talk for the api platform talk that goes into the depth of BDD support in api platform. Use Behat to write human readable feature and scenario descriptions. Accompanying demo repo for the basic behat test cases: https://github.com/coding-berlin/great-countries
Spring MVC 3.0 Framework
Objective:
1. Introduce Spring MVC Module
2. Learn about Spring MVC Components (Dispatcher, Handler mapping, Controller, View Resolver, View)
Slides:
1. What Is Spring?
2. Why use Spring?
3. By the way, just what is MVC?
4. MVC Architecture
5. Spring MVC Architecture
7. Spring MVC Components
8. DispatcherServlet
9. DispatcherServlet Architecture.........
.........................................................
Transactions and Concurrency Control PatternsJ On The Beach
Transactions and Concurrency Control Patterns by Vlad Mihalcea
Transactions and Concurrency Control are very of paramount importance when it comes to enterprise systems data integrity. However, this topic is very tough since you have to understand the inner workings of the database system, its concurrency control design choices (e.g. 2PL, MVCC), transaction isolation levels and locking schemes.
In this presentation, I’m going to explain what data anomalies can happen depending on the transaction isolation level, with references to Oracle, SQL Server, PostgreSQL, and MySQL.
I will also demonstrate that database transactions are not enough, especially for multi-request web flows. For this reason, I’m going to present multiple application-level transaction patterns based on both optimistic and pessimistic locking mechanisms.
Last, I’m going to talk about Concurrency Control strategies used in the Hibernate second-level caching mechanism, which can boost performance without compromising strong consistency.
Web services tutorial slides from my session at DPC 2012 in Amsterdam. In this 3-hour session we built the simplest possible service, and then extended it, looking at RPC, REST and SOAP along the way.
Advanced Web Services Hacking (AusCERT 06)Shreeraj Shah
Advanced Web Services Hacking - Attacks & Defense (AusCERT 2006).
Web services attacks are on the rise with evolution of web applications which are consuming back end web services over SOAP. UDDI, SOAP and WSDL are three important blocks of this new attack vectors. Several attacks are evolving around web services like UDDI enumeration, XPATH injection, XML poisoning, WSDL scanning, SOAP bruteforcing etc. At the same time new range of defense is evolving for web services with SOAP filtering. It is critical to know methodologies, attack vectors and defense strategies before deploying web services into the corporate environment. This paper will discuss advanced web services hacking methods and defense approaches.
We already showed you how to build a Beautiful REST+JSON API(http://www.slideshare.net/stormpath/rest-jsonapis), but how do you secure your API? At Stormpath we spent 18 months researching best practices, implementing them in the Stormpath API, and figuring out what works. Here’s our playbook on how to secure a REST API.
Transparencias que tratan cómo acceder a los datos de las peticiones bajo los distintos métodos HTTP y cómo servir distintos formatos de datos, además del consumo de servicios web.
Usado en el Curso de Extensión Universitaria "Desarrollo de aplicaciones web mediante servicios web y APIs abiertas" de la Universidad de Oviedo: http://directo.uniovi.es/postgrado/cabecera_ep.asp?Curso=2008&IdPrograma=5187
An introduction to REST and RESTful web services.
You can take the course below to learn about REST & RESTful web services.
https://www.udemy.com/building-php-restful-web-services/
Les Hazlewood, Stormpath co-founder and CTO and the Apache Shiro PMC Chair demonstrates how to design a beautiful REST + JSON API. Includes the principles of RESTful design, how REST differs from XML, tips for increasing adoption of your API, and security concerns.
Presentation video: https://www.youtube.com/watch?v=5WXYw4J4QOU
More info: http://www.stormpath.com/blog/designing-rest-json-apis
Further reading: http://www.stormpath.com/blog
Sign up for Stormpath: https://api.stormpath.com/register
Stormpath is a user management and authentication service for developers. By offloading user management and authentication to Stormpath, developers can bring applications to market faster, reduce development costs, and protect their users. Easy and secure, the flexible cloud service can manage millions of users with a scalable pricing model.
Simple REST-API overview for developers. An newer version is here: https://www.slideshare.net/patricksavalle/super-simple-introduction-to-restapis-2nd-version-127968966
These slides focus on documentation for REST APIs. See http://idratherbewriting.com for more detail. For the video recording, see http://youtu.be/0yfNd7tzH2Q. This deep dive is the second slide deck I used in the presentation.
Practices and tools for building better API (JFall 2013)Peter Hendriks
Een belangrijke voorwaarde om goede en leesbare Java code te schrijven is om gebruik te maken van een goede API. Een goede API helpt ontwikkelaars om sneller hoogwaardige code te schrijven. Het ontwerp van een API is daarom belangrijk, zeker als er grotere systemen worden gerealiseerd in teamverband. Moderne ontwikkeltools als Eclipse, IntelliJ IDEA en FindBugs helpen met het schrijven van goede API, en het detecteren van slecht gebruik. Deze sessie gaat in op de laatste ontwikkelingen en mogelijkheden, inclusief nieuwe taalmogelijkheden in Java 8. Er wordt hierbij gebruik gemaakt van praktische situaties en concrete codevoorbeelden, gebaseerd op echte ervaringen in grote codebases. Met praktische tips en toegankelijke tools kan al een grote stap gemaakt worden om in de praktijk beter met API ontwerp om te gaan!
APIs are must nowadays. We'll see how API Platform can help us bringing functional api platforms into production quickly. We will identify the key concepts of the framework, we will understand how to instruct it according to our needs and how it naturally integrates into the Symfony ecosystem.
Automation is integral to Cisco® Application Centric Infrastructure (ACI). Learn about the basic concepts necessary to begin effectively using the programmatic features of Cisco ACI. The session begins with an overview of the Cisco ACI object model, which describes how the system interprets configuration and represents state to internal and external entities. The Representational State Transfer (REST) API provides the means necessary to manipulate the object store, which contains the configured state of the Cisco Application Policy Infrastructure Controller (APIC) using the object model as the metadata definition. The session also covers the Cisco APIC software development kit (SDK) uses the REST API to read and write the configuration of Cisco APIC, using the object model to describe the current and desired states.
Super simple introduction to REST-APIs (2nd version)Patrick Savalle
See also: https://hersengarage.nl/rest-api-design-as-a-craft-not-an-art-a3fd97ed3ef4
An API in an interface or client-server-contract and REST is an HTTP design pattern. A REST-API is the de facto standard in web interface. It maps server resources onto URLs and allows CRUD-like manipulations of those (Create-Read-Update-Delete).
In this presentation we cover the basics of:
- The HTTP protocol
- The REST design pattern
- The API
Creating REST Applications with the Slim Micro-Framework by Vikram Vaswanivvaswani
Explains how to use the Slim PHP micro-framework to quickly deploy a REST API. Includes sample code to implement common API requirements, such as authentication, request logging and multi-format support.
Building Beautiful REST APIs with ASP.NET CoreStormpath
Join Stormpath .NET Developer Evangelist, Nate Barbettini, to learn best practices for designing your REST API in ASP.NET Core. Nate will explain how to build HATEOS-compliant JSON APIs while supporting security best practices and even improving performance and scale.
Topics Covered:
What is REST and HATEOS?
How to think about RESTful APIs
How to model hypermedia in C#
Building JSON APIs in ASP.NET Core
AWS July Webinar Series: Overview: Build and Manage your APIs with Amazon API...Amazon Web Services
How do you create APIs? When publishing a new API there are a lot of factors to consider: Versioning, Network Management, Authorization, Ecosystem Management, and finally client SDKs.
Amazon API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor, and secure APIs at any scale. With Amazon API Gateway, you can quickly declare an API interface and connect it to existing web services running on Amazon Elastic Compute Cloud (Amazon EC2) or code running on AWS Lambda, and generate an SDK for client applications to access the API. Amazon API Gateway handles all the tasks involved in accepting and processing up to hundreds of thousands of concurrent API calls, including traffic management, authorization and access control, monitoring, and API version management. Amazon API Gateway has no minimum fees or startup costs, and you pay only for the API calls you receive and the amount of data transferred.
Learning Objectives:
Learn how to create APIs in the AWS Cloud without managing a single server with AWS Lambda
Learn how to manage stages and versions of your APIs
Learn how to map parameters and transform data in flight
Design Summit - RESTful API Overview - John HardyManageIQ
This is an overview of the new RESTful API in the ManageIQ Anand release. Build cross-cloud applications and management systems using ManageIQ as a developer platform.
More more on ManageIQ, see http://manageiq.org/
Main focus of the talk is to communicate some key concepts of designing/implementing APIs based on an enterprise grade API Standards and Guidelines. We will try to handcraft few API recipes(i.e. implementation design) with real-life examples mixed with a live coding session. While working on each recipe, we will delve into the rationale behind design decisions and best practices. We believe that these concepts will help a developer build a comprehensive API solution from scratch.
Overview of GraphQL
How it is different from REST
When you should consider using it and when you should not
Incremental demos until calling GraphQL from an React application: https://github.com/bary822/graphQL-techtalk
Similar to REST API Best Practices & Implementing in Codeigniter (20)
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
2. Who Am I
• PHP Developer & Consultant
• Reviewed “Testing with Qunit”
• Helped to bring out thesis on “Business
Prospective of cloud computing”
• Founder of Website “WebGunny.com”
RIP Jun 2010 - Dec 2011
3. In this talk...
• Why REST API is a heart of every product
• REST API – As developer UI
• Best Practices of REST API
• REST API in codeigniter
8. Let’s Start with best practices
API End Point :
https://www.YourApp.com/Api/
OR
https://Api.YourApp.com/
Finally Format:
https://www.YourApp.com/Api/ResourceName
9. Identifying resources
• You can make the resources more sensible
based on your product
• For example
– Tasks
– Comments
– Notifications
– Users
– Projects
– Files
11. Make Use of HTTP Verbs
• GET /task - Retrieves a list of task
• GET /task/12 - Retrieves a specific task
• POST /task - Creates a new task
• PUT /task/12 - Updates task #12
• PATCH /task/12 - Partially updates task #12
• DELETE /task/ - Deletes all task
• DELETE /task/12 - Deletes task #12
12. Map the relationships
• GET /task/12/comments - Retrieves list of comments
for task #12
• GET /task /12/comments/5 - Retrieves comment #5 for
task #12
• POST /task /12/comments - Creates a new comments
in task #12
• PUT /task /12/comments/5 - Updates comments #5 for
task #12
• PATCH /task /12/comments/5 - Partially updates
comment #5 for task #12
• DELETE /task/12/comments/5 - Deletes comment #5
for task #12
13. Search Sort & Filter
• GET /tasks?sort=-priority - Retrieves a list of
task in descending order of priority
• GET /tasks?sort=-priority,created_at -
Retrieves a list of tasks in descending order of
priority then by date created
14. Aliases for common queries
To make the API experience more pleasant for
the average consumer
GET /tasks?status=completed
GET /tasks/recently_completed
15. Allow the fields to be selected
The API consumer doesn't always need the full
representation of a resource.
GET /task?fields=id,title,updated_at
16. Paging of data
Paging makes the API fast & responsive
GET /notification?page=1&per_page=50
17. Return full resource after action
• A PUT, POST or PATCH call may make
modifications to fields
• Return the updated (or created)
representation as part of the response.
• Prevent an API consumer from having to hit
the API again
18. Auto loading related
resources
{ "id" : 12,
“TaskName" : "I have a question!",
"summary" : "Hi, ....",
"customer" : { "name" : "Bob" },
assigned_user: { "id" : 42, "name" : "Jim", }
}
19. Make Error Message Friendly
• The API should always return sensible HTTP
status codes
• 400 series status codes for client issues & 500
series status codes for server issues
• API should standardize that all 400 series errors
come with consumable JSON error
representation
{ "code" : 1234,
"message" : “task field validation failed ",
"description" : “Due date is not set"
}
23. REST API in Codeigniter
UI/ Controller
Your App
Your API
Rest Client
24. What we need
• Codeigniter
• chriskacerguis/codeigniter-restserver
• Router implementation
25. Structuring the project
/application
/controller/
api/ //For all api controllers
/libraries //For the third-party libraries
REST_server.php
Format.php
/config //For all config files
Router.php
Rest_server.php
27. Creating a first API controller
require(APPPATH . '/libraries/Rest_Service.php');
class task extends REST_Service{
public function index_get() { //Logic }
public function index_post() { //Logic }
public function index_put() { //Logic }
public function index_patch() { //Logic }
public function index_delete() { //Logic }
}
28. Every Function has 2 Reaction
public function index_get() {
if($this->get('id'))
{
//Application Logic
$this->response($results,$code);
}
else
{
//Application Logic
$this->response($results,$code);
}
}
29. HTTP Action Vs SQL
• Get (select)
– Get All
– Get by ID
• Post (Insert)
• Put (update all fields )
• Patch (update selected fields)
• Delete (delete)
– Delete All
– Delete by ID
30. Summary
• REST API is heart of product
• REST API is a developer UI
• Follow the best practices of REST API
• Use “chriskacerguis/codeigniter-restserver” to
implement REST in codeigniter
I am a PHP Developer & Consultant
Have reviewed “Testing with Quinit”
Helped to bring out thesis on Business Prospective of cloud computing
Founder of webgunny.com – A iGaming portal whose revenue is based on advertisement. However, I shutdown that site after 1.8 years of operation
Let’s say you started building your next product – A task management system.
Users can login, add tasks, assign it to people in their team, discuss on a task, change status & so on.
You built it in MVC – It’s a Nice Architecture and launched it.
Around 10 users started using it...Few users became a fan of your app – A loyal users
They demanded the app to be on Mobile devices with good native experience.
Now the problem arises. You must rewrite the business logic for ios ,android, firefox os & so on.
It’s like redoing the whole app in all the devices!!! That’s wired!!!
Did we had made something which would have escaped us from this problem ?
Yes, you should have implemented a REST API – Representational state transfer Application Programming Interface
All your application, be it a desktop app, web app, mobile app will all your API to run your business logic
Once the API is being implemented you can integrate with Google Glasses, iWatches anything you name....
Now all your loyal users are happy. You customers increased.
Soon one of your customer want to integrate your app with his home grown app
Now you can ask your customer to use your API to integration
Of course, with some authentation & authorization
But...here is a catch..you actual API customer is not the end user. He is a developer
Now the question is to how to make the developer happy with your API
Simple answer – Build a developer friendly API
It’s definitely not a rocket science.
It’s just a common sense with some intelligence
Build your API around HTTP Action – GET, POST, PUT,PATCH,DELETE
In example you can see the first one retrieves all the tasks
Next , Map the relationship
First example retrives all the comments on a task #12
Build a mechanism to search/sort/filter
You can use some common sense here and build a aliases API call
For example build a separate API call to get all recently completed tasks
Let your API return full details about the task on every operation.
Say you updated a task by calling a API request.
Instead of just return Boolean if the activity is successful
Just return full details of the task
This will reduce the work of the developer to hit the API gain to get the updated data
It’s a best practice to related data.
For example, instead of just returning the assigned user ID
It Return the whole user object/resource along with the user name.
This will also reduce the number of hits to API server
Make errors friendly to understand. API should always return sensible HTTP status code
200 – For successfully operation
400 – For errors data validation etc
500 – For server errors
Also return the standard error object with the proper message stating why the operation failed.
It would be good if you can provide a code for all your errors.