The HTTP protocol adheres to the functional programming paradigm. This talk looks at HTTP on .NET and illustrates how F# allows for a more direct correlation to the patterns of composition inherent in the design of HTTP.
Overview of the JSON-RPC mechanism.
JSON-RPC is a simple RPC (Remote Procedure Call) mechanism, similar to XML-RPC.
Unlike XML-RPC which is a client-server protocol, JSON-RPC is a peer-to-peer protocol.
It uses JSON (Javascript Object Notation, RFC4627) as the serialization format and plain TCP streams or HTTP as transport mechanism.
JSON-RPC defines the three message types Request, Response and Notification. There is no direct mapping of JSON-RPC message to HTTP request. HTTP or plain TCP are merely transport protocols that carry JSON-RPC messages.
JSON-RPC is a simple protocol and therefore lacks most of the features that big web services like SOAP/WSDL and the WS-* standards provide. JSON-RPC may be suited for web service applications with the need for bidirectional interaction (peer2peer), but where the complexity of SOAP is not required.
PHP 5.3 was released in 2009 and is the newest version of PHP. Bradley Holt will talk about the new features available including namespaces, closures (lamdba/anonymous functions), and late static binding. Learn how these new features might be useful to you and why the next major version of the big PHP frameworks will require PHP 5.3.
This presentation will discuss how the Representational State Transfer (REST) architectural style can be applied to the design of your web services.
You will learn how to use HTTP methods and status codes properly and we will discuss how to use Hypermedia As The Engine Of Application State (HATEOAS). The principles of REST and HATEOAS will be demonstrated through the Atom Publishing Protocol (AtomPub) using the Google Data APIs and other AtomPub implementations as examples.
Overview of the JSON-RPC mechanism.
JSON-RPC is a simple RPC (Remote Procedure Call) mechanism, similar to XML-RPC.
Unlike XML-RPC which is a client-server protocol, JSON-RPC is a peer-to-peer protocol.
It uses JSON (Javascript Object Notation, RFC4627) as the serialization format and plain TCP streams or HTTP as transport mechanism.
JSON-RPC defines the three message types Request, Response and Notification. There is no direct mapping of JSON-RPC message to HTTP request. HTTP or plain TCP are merely transport protocols that carry JSON-RPC messages.
JSON-RPC is a simple protocol and therefore lacks most of the features that big web services like SOAP/WSDL and the WS-* standards provide. JSON-RPC may be suited for web service applications with the need for bidirectional interaction (peer2peer), but where the complexity of SOAP is not required.
PHP 5.3 was released in 2009 and is the newest version of PHP. Bradley Holt will talk about the new features available including namespaces, closures (lamdba/anonymous functions), and late static binding. Learn how these new features might be useful to you and why the next major version of the big PHP frameworks will require PHP 5.3.
This presentation will discuss how the Representational State Transfer (REST) architectural style can be applied to the design of your web services.
You will learn how to use HTTP methods and status codes properly and we will discuss how to use Hypermedia As The Engine Of Application State (HATEOAS). The principles of REST and HATEOAS will be demonstrated through the Atom Publishing Protocol (AtomPub) using the Google Data APIs and other AtomPub implementations as examples.
Impala: A Modern, Open-Source SQL Engine for HadoopAll Things Open
All Things Open 2014 - Day 1
Wednesday, October 22nd, 2014
Ricky Saltzer
Software Engineer of Internal Tools for Cloudera
Big Data
Impala: A Modern, Open-Source SQL Engine for Hadoop
An overview of how to structure your Lumen APIs to make them awesome. Topics covered: requests, responses, logging, documentation and testing.
Slides assume some background in Laravel.
Fluentd meetup dive into fluent plugin (outdated)N Masahiro
Fluentd meetup in Japan. I talked about "Dive into Fluent plugin".
Some contents are outdated. See this slide: http://www.slideshare.net/repeatedly/dive-into-fluentd-plugin-v012
Abstract:
Jini has served Orbitz well, but at the cost of tight coupling due in part to shared code and Java™ platform serialization rules. To improve agility, Orbitz is migrating to a RESTful Web services architecture using protocol buffers to define message formats. The result is loosely coupled services with autonomous lifecycles supporting evolvability and innovative mashup-style development.
This session is intended for experienced architects and tech leads who are familiar with distributed systems and data encoding methods.
It covers
• Using document schemas to constitute language-neutral contracts
• Using standard HTTP plumbing and intermediaries
• Implementing a reverse proxy for request routing based on RESTful URLs
• Applying OLAs for governance and service isolation
• Writing automated service layer tests to ensure backward compatibility
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Today’s web and mobile app localization industry relies on numerous standards, libraries and file formats to facilitate the exchange between developers and translators. While some formats are somewhat sophisticated, others lack even the most basic features, like pluralization and contextualization. And most can’t offer support for more advanced localization features, like language cases.
The most common localization formats include Gettext PO, PHP Arrays, Android XML, YAML, .Net RESX, iOS Strings and many others. A typical developer today works with many frameworks - for instance a Laravel backend app (PHP Arrays) with Ember front end (i18n JS) and iOS mobile app (Strings). Since all standards have distinct syntax, in many cases translations cannot be shared across applications.
Translation Markup Language (TML) aims to solve both these problems by introducing a powerful extensible cross-platform syntax that offers support for pluralization, language contextualization, language cases, reusable decorators and much more. TML libraries are available for all major web and mobile platforms. TML allows translators to do in-context translations - where they can translate right from within the apps. TML libraries also eliminate the need for developers to ever deal with the resource files, as all extractions and translation substitution is done realtime and the resource files are only used as a transport between the apps and the Translation Exchange platform.
Translation Exchange stores all translations in Universal Translation Memory (UTM), a graph database which stores all translations with their context, tone, rank and other attributes for accurate matching. This allows translations to be shared across all apps in the Translation Exchange Network. The translation memories of each app are extracted from the UTM graph and are managed by their individual localization teams. During this presentation we will look at some of the features of TML and how it can be used to quickly translate a Laravel application into any number of languages using in-context translation tools. We will also look at how the data is stored and shared across applications using UTM.
Impala: A Modern, Open-Source SQL Engine for HadoopAll Things Open
All Things Open 2014 - Day 1
Wednesday, October 22nd, 2014
Ricky Saltzer
Software Engineer of Internal Tools for Cloudera
Big Data
Impala: A Modern, Open-Source SQL Engine for Hadoop
An overview of how to structure your Lumen APIs to make them awesome. Topics covered: requests, responses, logging, documentation and testing.
Slides assume some background in Laravel.
Fluentd meetup dive into fluent plugin (outdated)N Masahiro
Fluentd meetup in Japan. I talked about "Dive into Fluent plugin".
Some contents are outdated. See this slide: http://www.slideshare.net/repeatedly/dive-into-fluentd-plugin-v012
Abstract:
Jini has served Orbitz well, but at the cost of tight coupling due in part to shared code and Java™ platform serialization rules. To improve agility, Orbitz is migrating to a RESTful Web services architecture using protocol buffers to define message formats. The result is loosely coupled services with autonomous lifecycles supporting evolvability and innovative mashup-style development.
This session is intended for experienced architects and tech leads who are familiar with distributed systems and data encoding methods.
It covers
• Using document schemas to constitute language-neutral contracts
• Using standard HTTP plumbing and intermediaries
• Implementing a reverse proxy for request routing based on RESTful URLs
• Applying OLAs for governance and service isolation
• Writing automated service layer tests to ensure backward compatibility
PHP stands for “PHP: Hypertext Preprocessor”. It is very good for creating dynamic content. PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Today’s web and mobile app localization industry relies on numerous standards, libraries and file formats to facilitate the exchange between developers and translators. While some formats are somewhat sophisticated, others lack even the most basic features, like pluralization and contextualization. And most can’t offer support for more advanced localization features, like language cases.
The most common localization formats include Gettext PO, PHP Arrays, Android XML, YAML, .Net RESX, iOS Strings and many others. A typical developer today works with many frameworks - for instance a Laravel backend app (PHP Arrays) with Ember front end (i18n JS) and iOS mobile app (Strings). Since all standards have distinct syntax, in many cases translations cannot be shared across applications.
Translation Markup Language (TML) aims to solve both these problems by introducing a powerful extensible cross-platform syntax that offers support for pluralization, language contextualization, language cases, reusable decorators and much more. TML libraries are available for all major web and mobile platforms. TML allows translators to do in-context translations - where they can translate right from within the apps. TML libraries also eliminate the need for developers to ever deal with the resource files, as all extractions and translation substitution is done realtime and the resource files are only used as a transport between the apps and the Translation Exchange platform.
Translation Exchange stores all translations in Universal Translation Memory (UTM), a graph database which stores all translations with their context, tone, rank and other attributes for accurate matching. This allows translations to be shared across all apps in the Translation Exchange Network. The translation memories of each app are extracted from the UTM graph and are managed by their individual localization teams. During this presentation we will look at some of the features of TML and how it can be used to quickly translate a Laravel application into any number of languages using in-context translation tools. We will also look at how the data is stored and shared across applications using UTM.
This article tries to demystify HTTP, "servlet", "web server", "application server", "servlet container" and gives the fundamentals of the Java Servlet API (that comes with the J2EE SDK).
Web technologies are in a constant state of flux. It’s impossible to predict which will fail, which will shine brightly then quickly fade away, and which have real longevity. Rapid innovation is what makes web app development so exciting, but shiny new things shouldn’t be pursued without a solid understanding of the underlying web platform.
My Node.js workshop from Sela's Developer Conference 2015.
In the Workshop we covered The basics Node.js api's and the express web application framework.
WCF is not just for SOAP based services and can be used with popular protocols like RSS, REST and JSON. Rob Windsor covers URI templates, the importance of HTTP GET in the programmable web, how to expose service operations via HTTP GET, how to control the format of data exposed by service operations, and finally how to use the WebOperationContext to access the specifics of HTTP.
ASP.NET Web API is the de facto framework for building HTTP-based services in the .NET ecosystem. With its WCF and MVC lineage, Web API brings to the table better architecture, easier configuration, increased testability, and as always, it's customizable from top to bottom. But to properly use Web API it is not enough to get familiar with its architecture and API, you also need to really understand what HTTP is all about. HTTP is the most common application layer protocol in the world, and yet, not many web developers are familiar with HTTP concepts such as of chunking, caching, and persisted connections. In this full-day tutorial, we will focus on designing and implementing HTTP-based services with ASP.NET Web API, and you will learn how to better use it to implement the features provided by HTTP.
This presentation walks through essential points for developing and working with REST APIs or web services to communicate through various platforms. This also explains HTTP methods.
Talk about server-side programming in F# from Functional Programming eXchange 2011 at SkillsMatter. The talk progresses from callback-based programming to asynchronous workflows and to agents in F#.
The F# community has been steadily working on extensions to the F# core libraries. These extensions provide helpful features that are "missing," add common parts found in other functional languages, and help with compatibility in other .NET languages.
Workshop slides from the Alt.Net Seattle 2011 workshop. Presented by Wes Dyer and Ryan Riley. Get the slides and the workshop code at http://rxworkshop.codeplex.com/
Presented at Houston Tech Fest 2009.
F# is the new kid on the block, and many are wondering why they should care. F# offers a lot of really elegant solutions to some tasks many avoid simply because of the pain involved. What many don't realize is that F# was the basis for a lot of time-saving tools now available in C#, such as LINQ. That's not to say everyone should switch all their projects from VB.NET and C# to F#. Find out how you can start leveraging F# in your current projects by using the right language for the right job.
Presented at Houston Tech Fest 2009.
Many developers use enterprise service bus (ESB) tools such as BizTalk or, for those looking at a lighter-weight approach, NServiceBus. What many fail to realize is that we have another option, one that has been tried and tested for many years and that we all use daily: HTTP. Find out how HTTP can deliver a much more maintainable, simpler solution to your ESB problems.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
5. Current Options
O http.sys
O HttpListener
O IIS (IHttpModule & IHttpHandler)
O Web Forms
O MVC
O WCF HTTP & Data Services
6. Future Options
O System.Net.Http (BETA)
O .NET 4.5
O Available on NuGet
O ASP.NET Web API (BETA)
O Builds on System.Net.Http
O Integrated with MVC 4
7. OSS Options
Frameworks Servers
O FubuMVC O Firefly (OWIN)
O MonoRail O Fracture (F#)
O NancyFx
O Kayak (OWIN)
O OpenRasta
O Manos de Mono
O OWIN/Gate
O ServiceStack.NET O Mono XSP
O WebSharper
O … and many more!
9. Component Parts
O Request/Response Lines
O Methods, URIs, Status Codes
O Headers
O General, Request, Response, Content
O Resources
O Representations
O Hypermedia
15. HttpListener
O Low-level
O Defines the signature for a single application only
O HttpListenerContext provides a singleton; no
chance to intercept and chain behavior
O Routing requests requires custom handling;
typically by using imperative if-then-else
O No means of chaining or composing multiple
listeners
16. HttpListener
HttpListener.Start
("http://localhost:8082/", (fun (request, response) -> async {
match request.Url.LocalPath with
| "/post" ->
// Send message to the chat room
room.SendMessage(request.InputString)
response.Reply("OK")
| "/chat" ->
// Get messages from the chat room (asynchronously!)
let! text = room.AsyncGetContent()
response.Reply(text)
| s ->
// Handle an ordinary file request
let file =
root + (if s = "/" then "chat.html" else s.ToLower())
if File.Exists(file) then
let typ = contentTypes.[Path.GetExtension(file)]
response.Reply(typ, File.ReadAllBytes(file))
else
response.Reply(sprintf "File not found: %s" file) }),
cts.Token)
17. IHttpModule & IHttpHandler
O Low-level
O HttpContext has the same problems as
HttpListenerContext
O IHttpHandler could represent a Resource, but
method mapping is imperative
O IHttpModule provides a middleware layer for
routing or hosting multiple IHttpHandlers
O System.Web.Routing surfaces the routing
component
19. ASP.NET Web Forms
O HTML composition via
MasterPages, Pages, and Controls
O Suffers many problems associated with
IHttpModule and IHttpHandler
O Evented model allows for interception
O No built-in support for other representations
O Pages loosely correlate to Resources
O Application composition and routing by file
path
20. ASP.NET MVC
O Suffers many problems associated with
IHttpModule and IHttpHandler
O Primarily HTML generation but allows for better
HTTP control
O Built-in support for handling Ajax requests
O ActionFilters allow for behavior composition at
different points:
Authorize, ActionExecuting, ActionExecuted, Resul
tExecuting, ResultExecuted
21. ASP.NET MVC, cont.
O Content Negotiation is still very manual
O ViewEngines and Serializers can be made to
render various representations
O ViewEngines offer representation composition
O Controllers ~ Resources, but not quite
O Areas and Routing allow for Nested
Resources, to a degree
22. Problem Summary
O Have:
O Limited interception for cross-cutting
concerns
O Representation composition
O Do not have:
O No easy resource composition
O No built-in content negotiation
23. Composition for Conneg
O Rendering
O Imperative if-then-else
O Serializers
O Location
O Within the specific method handler (common for
imperative)
O Top-level (common for serializers)
O Why not both?
24. Nested Resources
O Imperative if-then-else
O Routing
O MVC Areas offer another level
O What about more than one level?
O Rails – problem with deep URIs
O System.Web.Routing does everything at the
top-level, so tracking deeper resource trees is
difficult.
27. Frank
O F# DSL using System.Net.Http
O Headers composition
O Follows the natural composition of HTTP
O Frank Resources == HTTP Resources
O Define your own conventions!
29. Define a Method Handler
// handler
let echo request = async {
let! body = request.Content.AsyncReadAsString()
return HttpResponseMessage.ReplyTo(request, body)
}
// method handler
get echo
30. Define a Resource
let helloworld request = async { … }
let echo request = async { … }
let resource = route “/” (get helloworld <|> post echo)
31. Define an Application
let todoListResource = route “/” (get todoList <|> …)
let todoItemResource = route “/item/{1}” (put …)
let app = merge [ todoListResource; todoItemResource ]
32. Leverage Conneg
val negotiateMediaType = formatters ->
HttpRequestMessage ->
string ->
Async<HttpResponseMessage>
let echo = negotiateMediaType formatters
<| fun request ->
request.Content.AsyncReadAsString())
33. WebSharper
O One language for both client and server
O Can leverage to cleanly separate parts
O Use WebSharper to generate code-on-
demand to send to the client
O Plays well with existing tools
35. Resources
O ASP.NET Web Forms in F#
O ASP.NET MVC in F#
O Figment DSL for MVC
O Frank DSL for Web API
O WebSharper
O Pit FW
36. Thank you!
O Please rate this talk:
http://speakerrate.com/talks/9293-the-
functional-web
Editor's Notes
HTTP defines several components that allow distributed, loosely-coupled agents to communicate. The first lines of requests and responses are standardized to ensure that loosely-coupled components can understand one another, yet they allow for extension either by standards bodies or for internal, proprietary use.
This may be new to some, but this resource is not the same as the collection of items at /items.
The aggregate of many resources is generally what we refer to as an HTTP, or Web, Application. A single resource is enough, as is a single method.
Resources may be directly returned in a response. In the beginning, when most HTTP applications served static files, this was common. However, Resources are not equivalent to the representation returned to the client, even if they appear identical. Unlike editing files locally, if you were to edit a file returned from an HTTP application, you would not be editing the original file. You would need to re-submit the file to the server, if allowed, and then the server would need to take the content you supplied and update the original Resource.It is thus reasonable to understand that a Resource can be represented in more than one way. A JSON representation is just as valid as XML, HTML, or even an image.Content negotiation, or “conneg,” is a cross-cutting concern that allows HTTP applications to select an appropriate representation to send in the response message. The actual execution of this selection could occur either at the top-level or at the lowest-level of a composed HTTP application.
It’s also important to note that the request and response headers are just NameValueCollections, so you don’t have easy, typed access to common header values. This isn’t critical for composition but odd for a statically-typed language platform.DEMO: In spite of its short-comings, you can still do some interesting things with HttpListener. Tomas Petricek created a really interesting project where he uses HttpListener as the base for a chat server.
It’s also important to note that the request and response headers are just NameValueCollections, so you don’t have easy, typed access to common header values. This isn’t critical for composition but odd for a statically-typed language platform.DEMO: In spite of its short-comings, you can still do some interesting things with HttpListener. Tomas Petricek created a really interesting project where he uses HttpListener as the base for a chat server.
It’s important to note here that these interfaces are exposed by IIS and can be used to modify that server directly, though they are also tied directly to that server. Mono offers additional options for hosting, but you should understand that you are generally tied to IIS.
It’s important to note here that these interfaces are exposed by IIS and can be used to modify that server directly, though they are also tied directly to that server. Mono offers additional options for hosting, but you should understand that you are generally tied to IIS.
ASP.NET Web Forms 4.0 provided a hook intoSystem.Web.Routing.Also of note:Web Forms has historically been demonized by it’s poor HTML output, requiring a <form> element to scope control usage.Many server controls have weird behavior. Anchor tags, which generally perform GET requests instead POST back to server, even just to navigate to another page. Some of this is of course avoidable, but the designer-centric focus often leads to ill-advised HTTP use.FSharpCodeDomProvider has limitations.
Also difficult to use F# for View Models. You will have a difficult time using records and discriminated unions as types, and you’ll be forced into mutability.
Current frameworks typically choose to lean on one or the other of the above sets of options. However, there really should be no reason to require only one or the other. In fact, you should be free to define various boundaries where you might use a serializer approach over a subset of resources.
Routing is nothing more than filtering down a set of handlers to select the appropriate one and return a response.A Response is nothing more than a map function over a request, though it is true that some HTTP methods are destructive (e.g. POST).Pulling handlers into resources or applications is nothing more than a reduce function. Frank uses merge; WebSharper uses Sum.
For those with a stronger bent towards building web sites, Mauricio Scheffer’s Figment may be a closer match to your taste.
Compare the Frank application signature with the simplest app signature we used above. The only addition is that we are stating that an application is non-blocking. This is the same idea as is used in node.js. It’s also sort-of required since Frank sits on System.Net.Http via MessageHandlers. The signature for the MessageHandler.SendAsync is the same but for Task rather than Async. This signature extends all the way through all layers of composition.
A resource is the only current location that does not conform solely to the Frank application signature. A resource holds both a Uri Template (its name) as well as a HttpRequestMessage -> Async<HttpResponseMessage> option. Why the option? The resource will respond with a 405 Method Not Allowed if it does not respond to the method thrown its way. Thus the option allows the programmer to define the methods for the resource without having to manually hook up the 405 response.
Similar to resource, merge is a function of HttpRequestMessage -> Async<HttpResponseMessage> option. When a resource uri is not found, a 404 Not Found response is returned. The result, however, is a Frank application.
Frank currently uses Mauricio Scheffer’sFsConneg library, now in FSharpx.Http. System.Net.Http has a similar mechanism, but it’s currently still a little heavy as they work out the kinks in preparation for the RC. FsConneg provides a mechanism for submitting the Accept headers and a list of supported formats and returns the best match. negotiateMediaType wraps that with the selection of the appropriate formatter, of type System.Net.Http.Formatting.MediaTypeFormatter, and returns the formatted content.
Another option is Pit FW, which was featured on the Community for F# on 2/21/2012 (today). It also compiles F# to JavaScript. You can learn more at http://pitfw.org/.
Using F# for web projects isn’t just about code size. Yes, you’ll save some lines of code, but more importantly, you’ll work closer to the guts of HTTP. You can leverage the power of composition to build applications that will be more maintainable and much clearer to understand.