{"id":153,"date":"2018-03-20T12:14:20","date_gmt":"2018-03-20T10:14:20","guid":{"rendered":"http:\/\/companies.mybroadband.co.za\/bbd\/?p=153"},"modified":"2023-09-29T08:17:07","modified_gmt":"2023-09-29T06:17:07","slug":"spring-has-sprung-in-the-development-community","status":"publish","type":"post","link":"https:\/\/companies.mybroadband.co.za\/bbd\/2018\/03\/20\/spring-has-sprung-in-the-development-community\/","title":{"rendered":"Spring has sprung in the development community"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-157 size-full\" src=\"https:\/\/companies.mybroadband.co.za\/bbd\/files\/2018\/03\/Rory-Preddy.jpg\" alt=\"\" width=\"640\" height=\"430\" srcset=\"https:\/\/companies.mybroadband.co.za\/bbd\/files\/2018\/03\/Rory-Preddy.jpg 640w, https:\/\/companies.mybroadband.co.za\/bbd\/files\/2018\/03\/Rory-Preddy-300x202.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Functional reactive programming (FRP) is not a new idea, but with more frameworks coming into the mainstay and reactive programming more widely adopted, developers need to stay on top of trends.<\/p>\n<p>BBD\u2019s software developer whizz, Rory Preddy, explores FRP with Spring 5.<\/p>\n<h3><strong>Why is this something we should be talking about? <\/strong><\/h3>\n<p>Reactive programming revolves around models that are built to react to change. Recently Spring has made itself the de facto standard for Enterprise Java, predominantly as Oracle has \u2018abandoned\u2019 JavaEE i.e. Oracle is still heavily involved but in flux as they\u2019re migrating to the Eclipse foundation \u2013 with Eclipse attempting to mimic the Spring frameworks. This goes against intuition as Spring already exists and for developers looking for a stable enterprise platform, Spring 5 is it.<\/p>\n<h3><strong>Has Spring become the Enterprise platform of choice? <\/strong><\/h3>\n<p>Yes. With certain libraries only moving to Eclipse \u2013 Spring is the safer bet for developers.<\/p>\n<p><strong>Would you say that Spring has the longevity to maintain this position as the de facto choice? <\/strong><\/p>\n<p>Pivotal, the provider, is managing it well as they\u2019ve invested in providing training, maintenance and support. This means that not only is there someone to call to resolve any issues, they believe in the longevity of the framework.<\/p>\n<h3><strong>What\u2019s new in Spring 5? <\/strong><\/h3>\n<p>Spring 5 has three main changes:<\/p>\n<ul>\n<li>Full end-to-end Java 8 compatibility. You must use Java 8 and yes, we know Java 10 is releasing later in March, but that\u2019s a story for another day<\/li>\n<li>Netty: a full non-blocking web server to use in conjunction with Spring 5<\/li>\n<li>WebFlux: the standard front-end model view controller<\/li>\n<\/ul>\n<p>These changes are exciting, as WebFlux is providing more control over the web request handling. This means developers can write a good non-blocking protocol, using what WebFlux is describing as request mapping.\u00a0 I haven\u2019t seen this before, and to be honest it\u2019s very complicated because a developer needs to write their own protocol handler but in a non-blocking fashion.<\/p>\n<p>Luckily, the old-school Java developers are still catered for and you can use standard controller syntax for non-blocking handling.<\/p>\n<h3><strong>What features of FRP do developers need to be aware of?<\/strong><\/h3>\n<p>These three features are all those of reactive programming, with a functional flair added to them:<\/p>\n<ul>\n<li><strong>Composionality: <\/strong>tough to say, but it basically means that services need to be composed of multiple small functions. It\u2019s bit-by-bit, high level programming with Java 8.<\/li>\n<li><strong>Immutability: <\/strong>certain classes and objects in Java shouldn\u2019t change. This gives a developer the ability to control the state of the underlying system because you know it won\u2019t change. Java has traditionally been terrible at immutability, as there aren\u2019t whole collections that are immutable. To get around this in Spring 5, Java has provided base objects that remain immutable. The jury is still out as to whether this will work well for Java developers.<\/li>\n<li><strong>Inherent parallelisability<\/strong>: the ability to scale in parallel, is guaranteed with the Spring 5 framework when using WebFlux. This is an excellent thing because with the cloud the ability to scale is very important, but scaling gracefully is even more so.<\/li>\n<\/ul>\n<h3><strong>How could a Java developer scale gracefully using Spring 5? <\/strong><\/h3>\n<p>One of the features that allows these reactive services to scale gracefully is the ability to use back pressure, and WebFlux now has this built in. Back pressure has actually been around for a long time, despite many developers not knowing exactly it is.<\/p>\n<p>What this means for the developer is that if you are not coping, you can tell the system to slow down. If you want to throw the data away, you do so at your own discretion. It\u2019s about consuming what you want and how you want, with the system not mandating that you consume at a speed that you are uncomfortable with. A reactive stream\u2019s main purpose is to allow the developer to control how fast or how slow the publisher will produce data.<\/p>\n<p>Back pressure works both ways \u2013 if you need to speed up certain containers or servers, you can do so, and gracefully.<\/p>\n<p>This all results in developers now being able to send big data to a consumer across a standard rest endpoint, that gracefully expands to allow the consumption of that data. This brings a fascinating \u2018near\u2019 data science element to Spring 5 and reactive programming.<\/p>\n<p>At BBD, we have a heavy Java investment, so as JavaEE becomes less of a choice, Spring 5 is on track to become our go-to platform. This could be the route many software development organisations choose and Spring 5 developers need to be familiar enough with this to decide whether to go reactive with it or not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Functional reactive programming (FRP) is not a new idea, but with more frameworks coming into the mainstay and reactive programming more widely adopted, developers need to stay on top of trends.<\/p>\n","protected":false},"author":1,"featured_media":157,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":2,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/posts\/153\/revisions\/159"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/media\/157"}],"wp:attachment":[{"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/companies.mybroadband.co.za\/bbd\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}