FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/Multitier_programming

Multitier programming

Contents
    Echo application in ScalaLoci
List of multitier programming languages
References

Multitier programming (or tierless programming) is a programming paradigm for distributed software, which typically follows a multitier architecture, physically separating different functional aspects of the software into different tiers (e.g., the client, the server and the database in a Web application). Multitier programming allows functionalities that span multiple of such tiers to be developed in a single compilation unit using a single programming language. Without multitier programming, tiers are developed using different languages, e.g., JavaScript for the Web client, PHP for the Web server and SQL for the database. Multitier programming is often integrated into general-purpose languages by extending them with support for distribution.

Concepts from multitier programming were pioneered by the Hop and Links languages and have found industrial adoption in solutions such as Ocsigen, Opa, WebSharper, Meteor or GWT.

Multitier programming provides a global view on the distributed system. This aspect has been shown similar to other programming paradigms such as choreographic programming, macroprogramming, and aggregate computing.

funecho(item)server{ item } funmain()server{ page <html> <body> <forml:onsubmit="{appendChildren(<li>{stringToXml(echo(item))}</li>, getNodeById("list"))}"> <inputl:name="item"/> <buttontype="submit">Echo!</button> </form> <ulid="list"/> </body> </html> } main()

Links uses annotations on functions to specify whether they run on the client or on the server (Line 1 and 5). Upon request from the client, the server executes the main function (Line 18), which constructs the code that is sent to the client. Links allows embedding XML code (Line 7–15). XML attributes with the l: prefix are treated specially. The l:name attribute (Line 10) declares an identifier to which the value of the input field is bound. The identifier can be used elsewhere (Line 9). The code to be executed for the l:onsubmit handler (Line 9) is not immediately executed but compiled to JavaScript for client-side execution. Curly braces indicate Links code embedded into XML. The l:onsubmit handler sends the current input value item to the server by calling echo. The item is returned by the server and appended to the list of received items using standard DOM APIs. The call to the server (Line 9) does not block the client. Instead, the continuation on the client is invoked when the result of the call is available. Client–server interaction is based on resumption passing style: Using continuation passing style transformation and defunctionalization, remote calls are implemented by passing the name of a function for the continuation and the data needed to continue the computation.

Echo application in ScalaLoci

edit
li(message) }) }\n val inp = input.render\n dom.document.body = body(\n div(\n inp,\n button(onclick := { () => message.fire(inp.value) })(\"Echo!\")),\n list.asFrag).render\n }\n}\n"}}'>@multitierobjectApplication{ @peertypeServer<:{typeTie<:Single[Client]} @peertypeClient<:{typeTie<:Single[Server]} valmessage=on[Client]{Event[String]()} valechoMessage=on[Server]{message.asLocal} defmain()=on[Client]{ valitems=echoMessage.asLocal.list vallist=Signal{ol(items()map{message=>li(message)})} valinp=input.render dom.document.body=body( div( inp, button(onclick:={()=>message.fire(inp.value)})("Echo!")), list.asFrag).render } }

ScalaLoci is a language that targets generic distributed systems rather than the Web only, i.e., it is not restricted to a client–server architecture. To this end, ScalaLoci supports peer types to encode the different tiers at the type level. Placement types are used to assign locations to data and computations. ScalaLoci supports multitier reactives – language abstractions for reactive programming that are placed on specific locations – for composing data flows cross different peers.

The application first defines an input field (Line 11) using the ScalaTags library. The value of this field is used in the click event handler of a button (Line 15) to fire the message event with the current value of the input field. The value is then propagated to the server (Line 6) and back to the client (Line 9). On the client, the value of the event are accumulated using the list function and mapped to an HTML list (Line 10). This list is then used in the HTML (Line 16) to display the previous inputs.

List of multitier programming languages

edit

References

edit
Caldwell, Sam (2016). "General Purpose Languages Extended for Distribution". In Miller, Heather (ed.). Programming Models for Distributed Computing.
  • 1 2 Balat, Vincent (2006). "Ocsigen: typing web interaction with objective Caml": 84–94. doi:10.1145/1159876.1159889. S2CID 6131454.{{cite journal}}: Cite journal requires |journal= (help)
  • 1 2 Rajchenbach-Teller, D., & Sinot, Franois-Régis. (2010). Opa: Language support for a sane, safe and secure web. Proceedings of the OWASP AppSec Research, 2010(1).
  • 1 2 Kereki, Federico, 1960- (2011). Essential GWT: building for the web with Google Web toolkit 2. Upper Saddle River, NJ: Addison-Wesley. ISBN 978-0-321-70563-1. OCLC 606556208.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)
  • ↑ Beal, Jacob; Pianini, Danilo; Viroli, Mirko (2015). "Aggregate Programming for the Internet of Things". Computer. 48 (9). Institute of Electrical and Electronics Engineers (IEEE): 22–30. doi:10.1109/mc.2015.261. hdl:11585/520779. ISSN 0018-9162. S2CID 26413.
  • ↑ Serrano, Manuel (2006). "Hop: a language for programming the web 2.0": 975–985. doi:10.1145/1176617.1176756. S2CID 14306230.{{cite journal}}: Cite journal requires |journal= (help)
  • ↑ Chlipala, Adam (2015). "Ur/Web: A Simple Model for Programming the Web": 153–165. doi:10.1145/2676726.2677004. S2CID 9440677.{{cite journal}}: Cite journal requires |journal= (help)
  • ↑ Philips, Laure (2014). "Towards Tierless Web Development without Tierless Languages". Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software. pp. 69–81. doi:10.1145/2661136.2661146. ISBN 9781450332101. S2CID 15774367.
  • ↑ Carreton, Andoni Lombide (2010). "Loosely-Coupled Distributed Reactive Programming in Mobile Ad Hoc Networks". Objects, Models, Components, Patterns. Lecture Notes in Computer Science. Vol. 6141. pp. 41–60. doi:10.1007/978-3-642-13953-6_3. ISBN 978-3-642-13952-9.
  • ↑ Ekblad, Anton; Claessen, Koen (2015-05-11). "A seamless, client-centric programming model for type safe web applications". ACM SIGPLAN Notices. 49 (12): 79–89. doi:10.1145/2775050.2633367. ISSN 0362-1340.
  • ↑ Neubauer, Matthias (2005). "From sequential programs to multi-tier applications by program transformation". Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages. pp. 221–232. doi:10.1145/1040305.1040324. ISBN 158113830X. S2CID 10338936.
  • ↑ Tilevich, Eli (2002). "J-Orchestra: Automatic Java Application Partitioning". ECOOP 2002 — Object-Oriented Programming. Lecture Notes in Computer Science. Vol. 2374. pp. 178–204. doi:10.1007/3-540-47993-7_8. hdl:1853/6531. ISBN 978-3-540-43759-8.
  • ↑ Zdancewic, Steve (2002). "Secure program partitioning". ACM Trans. Comput. Syst. 20 (3): 283–328. doi:10.1145/566340.566343. S2CID 1776939.
  • ↑ Groenewegen, Danny M. (2008). "WebDSL: a domain-specific language for dynamic web applications": 779–780. doi:10.1145/1449814.1449858. S2CID 8073129.{{cite journal}}: Cite journal requires |journal= (help)
  • ↑ Richard-Foy, Julien (2013). "Efficient high-level abstractions for web programming". Proceedings of the 12th international conference on Generative programming: Concepts & experiences. pp. 53–60. doi:10.1145/2517208.2517227. ISBN 9781450323734. S2CID 14305623.
  • Programming paradigms
    Imperative
    Structured
    Object-oriented
    Declarative
    Functional
    Dataflow
    Logic
    Domain-
    specific
    language

    (DSL)
    Concurrent,
    parallel
    Metaprogramming
    Separation
    of concerns
    Comparisons/Lists
    Comparison (multi-paradigm, object-oriented, functional), List (OO, by type)

    View original on Wikipedia | Back | FazBrowse Home