Skip to content
Sandny Blog
  • Home
  • Java
  • JavaScript
  • AWS
  • Embedded
  • About
evolution of js apps EmberJS

Adaptation of js apps and how predesigned abstractions could…

  • October 18, 2017November 21, 2019
  • by Coder Kai

Through the last couple of years, javascript has drastically changed and the many developers have tried using different approaches to define their application structure and abstractions in a way which is best suits at that time. There is one thing to highlight which I intend to discuss, “Rapid Changes”. So how can a developer or an architect withstand these rapid changes to frameworks and awesome libraries introduced each day in the js context? With my experience, I learned a couple of facts which I think is necessary to embrace these changes until js development becomes structurally solid as engineered buildings.

Experience

One of the changes that I experienced is this huge change which occurred from ember.js 1.0 to 2.0. They rewrote the framework more component oriented than before. And suddenly community also turned “this will be fixed in 2.0 version!”, duh… There was an app which was developed into a monster code chunk of ember.js 1.0 and it was giving pain so much. The data down action up concept was causing too many constraints and the definition of controllers, components were like wild in the community. So how did we embrace the change? Is it a rewrite or updating the same code base?

The first option is a very very risky decision as the many apps are business oriented and can’t risk the value of the time to market in business decisions. With a platform already in a prod environment, a blooming startup can’t risk its reputation. But we cannot go towards the “Elephant in the room” state as the startup was going towards more co-operate hands and decisions were so strict in a sense.

Next, comes the upgrading the same code base in gracefully with the new features introduced(hoping the constraints would go away, but trust me it won’t happen!). Though this seems as the most favourable decision, migrating to a new framework was not so easy in a way as the previous code had too many layers which would be needed to change in a full manner. Following are the mistakes which could possibly occur in when migrating an existing code base towards a new framework level enhancement.

  1. No clear separation of the logic applied inside the code.
  2. No clear separation of the data layer and the view components.
  3. View and Controllers(or Components) are so tied that the change in a single layer would affect the whole functionality of a subsystem or a module.

And also let’s say somebody did separate the logic and creates the underlying app in a very robust manner. At the initial design phase, they will come up with a clear abstraction between logic, data, components and implement it from the scratch. Is it a good practice…? Well… hear this out.

The abstraction becomes evil

This time the whole app is like crystal and everybody is happy. The app has used react.js with redux and the requests are called asynchronously to fetch data and actions are dispatched like tiny ants at work. They built their own underlying framework for the app. And all the new features defined in the whole wide web at the moment is in our code base. Everyone is happy about it and then adds features one by one each day without updating it underlying app framework. And the code also grows exponentially. So what could go bad with this?

One day they face another issue introduced by the underlying app in such a way that it affects the whole code base. But what happens is the company is now thriving from the place of startup to being a co-operate management and they don’t want stop adding new features as well. So they found a new theme called “Technical Debt”. They start to pick and push every framework level changes to debt registry and don’t think of addressing them.

When time goes by, the debt becomes a serious problem to all and debts starts to speak for themselves. But devs try to hide it under the bed by introducing monkey patches to validate and do all sort of things to hide the smoke which comes up. And all the people will pretend like there is no issue at all in the app and try hide over and over again. This adds more weight if the project management also hasn’t been following proper SCRUM or DevOps practices. And especially deployment procedures. If the deployment units are scattered and there is no continuation of integration and delivery, there will be more fumes in dev teams to get the product enhancements to the market.

Depts are calling

But finally, there is a day where all the people who come to an agreement as they cant proceed further enhancements with the current implementations, wondering how they even get this far with this code base, which now has become a legacy app.

So how can we embrace this without giving up the velocity of market-ready production releases?

Evolution

evelution and adaption

The most trivial thing in the evolution theory is the adaptation. Species who could quickly be changed to the environment variables were the ones to remain for future. The ones who neglected to change, perished eventually when they cannot withstand what the environment was forcing them to do. Just like in our context, js world is changing rapidly and ones choose “What” and “When” are the ones who succeed the development and release cycle in most appreciative manner.

How? Is the question that most people want answers. So I think the most important thing is to use rapid iterative development cycles and repetitions in the code and introduce abstractions with the implementations. To simplify this we should start with a small startup who tries to develop their app with current technology available

  1. Get a good knowledge of the best-suited frameworks and libraries that could be used to develop the app with the projection for 2 years from the current position. Consider scalability, security, performance, availability as top pillars. And when I mean 2 years, don’t go with the technologicle buble now on the web. Go with a more reliable and best suited one. But do your homework as much as you can. Then you will see lots of things that you would have been wished to see before in a future perspect.
  2. Design data structures properly. Minimize data redundancy. Think of algorithms to shrink data. Think of more suitable js structures which would suit the best performance. Use single depth data structures without going into a more deeper level. Understand how V8 tries to optimize just in time compilation and avoid mixing the data types. Understand how immutable data structures should work and implement them correctly so that you won’t blame on the creators of immutable data libraries rather than understanding what happens in your own code.
  3. Algorithms. Even for a for loop, just focus on how much iterations are necessary and please do consider the complexity. If the 2nd point is crisp and clear in your framework, I guarantee you won’t have to consider this too much.
  4. Separation of logic and memoisation. You don’t have to waste your CPU cycles on resource-hungry operations over and over again. Use dynamic algorithms and memoisation to overcome the delays in rendering the view.
  5. Build your own underlying framework necessary for the app without using all the things shipped and sent from a framework. This was even encouraged by Dan Abramov who came up with redux.js framework. The idea is to customize your code to a level that you won’t be in a position to wait till the framework providers give you solutions. You are the captain of your ship and train your crew to craft the ship too so that you don’t need to dock in next harbour when you need to change the floor wood.
  6. Repetition and separation. This can be related to the DRY method(Don’t Repeat Yourself) in rails. First, code without using so many different files and module structures in your code base. For practice, just start with one file (don’t make it bigger more than 3000 lines of codes!). And when you see a repetition just separate it. And if you want more modular context, then introduce abstractions. Here without sticking into features provided by the frameworks, try some design patterns as well. Sometimes it could be very frustrating at first, but trust me, frustrations would give you the best solution afterwards.
  7. Don’t mutate the state and manage the state very carefully and selectively update the views so that the rendering is minimum. This is more redux oriented and this is very important when designing your app. Sometimes you might not notice how many renderings are happening in the app while you are updating the state. ALWAYS keep your eyes on it.
  8. Use pure functions and PureComponents as much as possible. Pure functions are so easy to manage and its a good practice. Sometimes you may need to use stateful components but it will be the best if you can use it in the places where it is necessary only.
  9. Iteration. When developing features, always develop with more atomic functionalities and get them done right. Identify the mistakes you did to your underlying framework and attack it as soon as possible. In this manner, you will be able to adapt to the requirements and environment of your app and enhance it without losing the grip.
  10. Consider synchronous and asynchronous actions and data requests wisely without using them blindly. If you are going to give framework level support to async actions, please take some time to realize whether you need it and what possible issues could arise in future.
  11. Minimize deployment time rather than development time. Most of the startups tend to lose the deployment automation and testing capabilities. It is vital to adapt into continuous principles without leaping forward. Because when you become a more co-operate business, you will feel the time is more valuable to push new features to production.

These steps may vary for your context, but the basic idea is valid. Without making a legacy code base, please adapt into more safer grounds as time goes by. Have a cleaner code and always try to clear up the debts no matter how high is your impact on existing production app.

Higher order component wrappers using React.js and reusable components.
How to create a neo4j BoltDriver Datasource and connect it with a web app
Coder Kai
A humble developer
javascript modular apps react.js redux.js

Related articles

Multiple refs for an array of React Elements
Using multiple refs for an…
Immutable and Mutable Values in Javascript
07. Immutable and Mutable Values…
wrapper objects in javascript
06. Wrapper objects in Javascript
globals undefined and null values in javascript
05 Global, null and undefined…
Javascript Booleans and Equality
04. Javascript Guide Booleans and…
How to add Chakra UI Animations
Chakra UI Animations
SSL Websocket using Nginx Proxy
SSL Websocket proxy with Nginx…
Change python version correctly
Python is not setting correct…
optimize React.js load time
How to optimize React.js app…
Multiple refs for an array of React Elements
How to use IntersectionObserver to…
Multiple refs for an array of React Elements
How to dismiss dropdowns when…
Javascript guide Strings
03. Javascript Guide – Strings
How to fetch data with useEffect
How to fetch data with…
add styles to stripe elements
How to add styles to…
Typescript
How to use Typescript with…
how to optimize react-native map view
How to optimize react-native map…
debounce with react hooks
Avoid multiple clicks using debounce…
Numbers inJavascript
02. Javascript Guide – Numbers
Introduction to Javascript
01. Javascript Guide – Introduction…
Nginx Load Balancer with docker…
34 COMMENTS
  • bitcoincasino
    November 25, 2022 at 9:32 am
    Reply

    When I read an article on this topic, bitcoincasino the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

  • BalaBuist
    December 17, 2022 at 11:13 am
    Reply

    propecia merck We can give our customers the best prices 14

  • Megan Atkinson
    August 29, 2023 at 11:05 am
    Reply

    Hi there,

    We run an Instagram growth service, which increases your number of followers both safely and practically.

    – Guaranteed: We guarantee to gain you 400-1200+ followers per month.
    – Real, human followers: People follow you because they are interested in your business or niche.
    – Safe: All actions are made manually. We do not use any bots.

    The price is just $60 (USD) per month, and we can start immediately.

    If you are interested, and would like to see some of our previous work, let me know and we can discuss further.

    Kind Regards,
    Megan

  • scholdingDip
    September 29, 2023 at 8:38 am
    Reply

    Быстровозводимые здания – это актуальные системы, которые отличаются повышенной быстротой установки и мобильностью. Они представляют собой сооружения, состоящие из предварительно сделанных составляющих или блоков, которые способны быть скоро собраны на территории развития.
    [url=https://bystrovozvodimye-zdanija.ru/]Строительство быстровозводимых сооружений[/url] обладают податливостью а также адаптируемостью, что позволяет легко изменять и адаптировать их в соответствии с пожеланиями клиента. Это экономически успешное а также экологически устойчивое решение, которое в последние лета приобрело широкое распространение.

  • Jameschini
    October 31, 2023 at 12:50 am
    Reply

    Howdy! [url=https://baclofen2024x7.top/#baclofen-cheap]buy baclofen pills online[/url] very good website.
    [url=https://baclofen2024x7.top/#]zkx[/url]

  • b^onus de indicac~ao da binance
    April 2, 2024 at 11:54 pm
    Reply

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  • k8gameiodaype
    October 21, 2024 at 5:42 am
    Reply

    CR真・北斗無双

    CR 真・北斗無双

    パチンコをすることで、運を試すドキドキ感が味わえます。挑戦する楽しさがあります。

    パチスロ 貞子3D

    https://www.wk8.jp/tags/%E7%89%B9%E6%AE%8A%E5%A4%A7%E8%B3%9E%E7%87%88%E3%81%AE%E9%AD%85%E5%8A%9B
    リーチ演出が多彩で、どのタイミングで大当たりが来るかドキドキします。

    CR真・北斗無双

    [url=https://sites.google.com/view/k8thedoghousemegaways]ドッグハウス メガウェイズ
    [/url]
    CR北斗の拳5 百裂

    CR牙狼 魔戒ノ花XX

    麻雀物語

  • Реферальная программа binance
    November 4, 2024 at 6:30 pm
    Reply

    Your article helped me a lot, is there any more related content? Thanks!

  • binance
    November 30, 2024 at 9:59 pm
    Reply

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  • 注册
    December 1, 2024 at 8:27 am
    Reply

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  • binance
    January 20, 2025 at 9:01 pm
    Reply

    Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

  • GenIPTV Provider
    January 31, 2025 at 1:03 am
    Reply

    The Best Premium IPTV Service WorldWide!

  • Justin Knox
    February 6, 2025 at 11:59 am
    Reply

    Utterly indited content material, thanks for selective information. “In the fight between you and the world, back the world.” by Frank Zappa.

  • berita dana
    February 8, 2025 at 1:51 am
    Reply

    UID_72942561###
    Berita Hot! 🔥🔥 Isa Rachmatarwata Tersangka Kasus Jiwasraya Buntut kerugian negara hingga 16,8 Triliun! 😲😲

  • berita dana
    February 8, 2025 at 5:51 am
    Reply

    UID_53550706###
    Berita terbaru! 🔥 Isa Rachmatarwata Ditahan Kejagung dalam kasus Jiwasraya. 🚔👮‍♂️

  • berita dana
    February 8, 2025 at 11:19 am
    Reply

    UID_57092237###
    Berita gembira! 🎉 Pasokan Gas 3 Kg di Kramat Jati Kembali Normal 🎊 Siap-siap belanja gas, ya! 💪🔥

  • berita dana
    February 8, 2025 at 2:38 pm
    Reply

    UID_72339950###
    Heboh! 📣🔥 Unjuk Rasa di Polda Jatim 📢 Menuduh Jokowi Terlibat Korupsi! 😱🔍

  • berita dana
    February 8, 2025 at 6:06 pm
    Reply

    UID_27764099###
    Ini yang di ganti >>> “Bingung Kenapa 😕❓” Federasi Sepak Bola Pakistan Disanksi FIFA “Baca Penyebabnya Disini! 🧐🔍”

  • berita dana
    February 8, 2025 at 10:19 pm
    Reply

    UID_74743238###
    Ini dia! 🎉🎉 ASN BKN Ubah Pola Kerja yang baru dan efisien! 🎉🎉.

  • berita dana
    February 9, 2025 at 10:09 am
    Reply

    UID_83344528###
    Inilah 🎉🎉 Pupuk Inovatif Kebun Riset Kujang yang bikin Wamen BUMN bangga! 💪🏻🇮🇩

  • 우리카지노더킹
    February 9, 2025 at 4:42 pm
    Reply

    I like what you guys are up also. Such intelligent work and reporting! Carry on the superb works guys I have incorporated you guys to my blogroll. I think it will improve the value of my web site :).

  • berita dana
    February 10, 2025 at 4:03 am
    Reply

    UID_21891068###
    Takjub 😮 dengan fenomena serbu gas? Yuk, baca Warung Tatang Diserbu Warga dan temukan faktanya! 🕵️‍♀️👀

  • slot gacor agentotoplay
    February 10, 2025 at 6:54 am
    Reply

    UID_25978847###
    situs terbaik hanya di slot gacor agentotoplay

  • 자세히 보기
    February 10, 2025 at 11:32 am
    Reply

    I just could not depart your web site before suggesting that I extremely enjoyed the usual information an individual supply in your visitors? Is gonna be again frequently in order to check up on new posts.

  • slot gacor agentotoplay
    February 11, 2025 at 3:19 am
    Reply

    UID_95859078###
    Baru-baru ini, para pemain Mahjong Wins 3 dikejutkan dengan bocoran RTP yang diklaim bisa meningkatkan peluang kemenangan secara signifikan. Banyak yang percaya bahwa informasi ini membantu mereka mendapatkan hasil yang lebih konsisten dalam permainan. Jika Anda ingin tahu lebih lanjut, cek bocoran RTP Mahjong Wins 3 hari ini dan lihat apakah strategi ini benar-benar efektif.

  • slot gacor agentotoplay
    February 11, 2025 at 8:58 am
    Reply

    UID_57331425###
    Skandal terbaru mengguncang komunitas pecinta game slot setelah seorang admin terkenal, Rachel, dikabarkan tertangkap membocorkan pola kemenangan Gate of Olympus. Banyak yang bertanya-tanya apakah informasi ini benar-benar akurat atau hanya sekadar rumor yang beredar di kalangan pemain. Simak lebih lanjut detailnya dalam artikel admin Rachel tertangkap bocorkan pola Gate of Olympus.

  • slot gacor agentotoplay
    February 11, 2025 at 4:46 pm
    Reply

    UID_17136916###
    Kisah inspiratif datang dari seorang tukang ojek online asal Tangerang yang berhasil membawa pulang hadiah fantastis setelah bermain Mahjong Ways 2. Dengan modal kecil, ia sukses mengubah nasibnya dan meraih kemenangan besar senilai 200 juta rupiah. Penasaran bagaimana caranya? Simak kisah lengkapnya di artikel tukang ojek online menang 200 juta dari Mahjong Ways 2.

  • slot gacor agentotoplay
    February 12, 2025 at 11:11 am
    Reply

    UID_87427935###
    Cek yuk! 🚍👮‍♂️Operasi Keselamatan 2025 Polres Ciamis Siapa tahu bus favoritmu jadi sasaran! 😱👍

  • slot gacor agentotoplay
    February 13, 2025 at 12:07 am
    Reply

    UID_18563832###
    Ini yang di ganti >>> Yuk, ketahui lebih lanjut tentang Syarat Gabung OECD dan Pentingnya Ratifikasi Konvensi Antisuap di sini! 🕵️‍♀️🔎📚.

  • slot gacor agentotoplay
    February 13, 2025 at 4:47 am
    Reply

    UID_83003169###
    Kenalan yuk! 🤝 Dengan guru inspiratif ini, Guru Dede Sulaeman yang mengajarkan cara merapikan pakaian di kelasnya. 👕👚🎓

  • slot gacor agentotoplay
    February 13, 2025 at 10:19 pm
    Reply

    UID_97211224###
    Yuk, sehat bersama! 👨‍⚕️👩‍⚕️ Cek kondisi tubuh kamu di Program Cek Kesehatan Gratis sekarang juga! 💉🌡️ Selalu jaga kesehatan, ya! 🏥💖

  • Eldon Tucker
    February 15, 2025 at 6:27 am
    Reply

    I like this post, enjoyed this one thanks for putting up. “We seldom attribute common sense except to those who agree with us.” by La Rochefoucauld.

  • Amber Baxter
    February 19, 2025 at 10:05 am
    Reply

    Its superb as your other articles : D, thanks for putting up. “There’s no Walter Cronkite to give you the final word each evening.” by William Weld.

  • binance
    February 26, 2025 at 9:44 am
    Reply

    Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • android 3
  • Apollo Client 1
  • AWS 8
    • AppSync 5
    • EC2 1
    • EKS 1
    • Route53 1
    • S3 1
  • AWS Amplify 1
  • Chakra UI 1
  • Docker 1
  • Embedded 1
  • EmberJS 1
  • FCM 1
  • Godaddy 1
  • GraphQL 3
  • ios 1
  • Jasper 1
  • Java 10
    • Java 11 1
    • Java 14 1
  • JavaEE 2
  • JavaScript 39
    • Express.js 4
    • Javascript Guide 7
    • Node.js 3
    • react-native 4
    • React.js 17
    • Typescript 1
  • Kubernetes 1
  • machine learning 1
  • Maven 2
  • OCaml 3
  • PostgreSQL 1
  • Python 2
  • react-native 4
  • ReactJS 3
  • sass 1
  • Server 6
  • spark 1
  • Terraform 2
  • Ubuntu 4
  • Uncategorized 1
  • webpack 2

Recent Comments

  • binance register on Chakra UI Animations
  • binance account on SSL Websocket proxy with Nginx for Graphql Subscriptions
  • Binance Pag-signup on How to fetch data with useEffect

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

  • October 2022 3
  • September 2022 7
  • May 2022 1
  • December 2021 1
  • August 2021 1
  • July 2021 6
  • June 2021 3
  • February 2021 1
  • July 2020 1
  • December 2019 5
  • November 2019 6
  • October 2019 3
  • August 2019 1
  • March 2019 1
  • February 2019 1
  • January 2019 2
  • December 2018 1
  • September 2018 2
  • August 2018 1
  • June 2018 1
  • February 2018 1
  • November 2017 2
  • October 2017 5
  • September 2017 1
  • June 2017 1
  • May 2017 10
Sandny Blog space
Theme by Colorlib Powered by WordPress