Programming & IT Tricks . Theme images by MichaelJay. Powered by Blogger.

Copyright

Facebook

Post Top Ad

Search This Blog

Post Top Ad

Responsive Ads Here

Archive

Post Top Ad

Contact


Editors Picks

Follow us

Post Top Ad

Fashion

Music

News

Sports

Food

Technology

Featured

Videos

Fashion

Technology

Fashion

Label

Translate

About

Translate

Sponsor

test

Weekly

Comments

Recent

Connect With us

Over 600,000+ Readers Get fresh content from FastBlog

About

Showing posts with label 5G. Show all posts
Showing posts with label 5G. Show all posts

Monday, October 15, 2018

Building your own Design Pattern


Hybrid MVC + MVVM


Ever so often, developers face the dilemma of choosing from multiple design patterns for their code. Yes, there are deadlines to adhere to, there are changing needs of the product, the code needs to be testable and what not! But as a developer, you always want to write code that’s scalable, modular and easy to debug for any issues, if not bug-free now — not an easy task by any means! You have to be very smart in locking down the foundation for your code. After all, it’s only on a strong foundation, that you can build a scalable structure.

What you’ll learn in this post:

  • What MVC, MVVM etc. are all about and some of their shortcomings
  • Why design patterns are an important part of development lifecycle
  • How you can alter some of the aspects of these patterns to come up with your own version, as per your use case
  • How we design high quality, stable features at Hike using our Hybrid design pattern

MVC

The standard MVC pattern has three major components:
Model — The Model is usually the data source of the system. It interacts with the controller to provide the current state of your database. Data can reside locally in your system, or fetched from the servers. In any case, the model provides you with the relevant information.
View — View is what you see on your screen. All the UI components together constitute the view. In standard MVC implementations, views are usually pretty dumb with no business logic to them. They get directions from the controller and populate themselves accordingly. Similarly, any actions that the user takes on the UI are passed on to the controller to handle.
Controller — This is where all the action happens! The Controller takes care of multiple things. Firstly, it instantiates both the Model and the View components. All business logic in response to user actions, asking the model to update itself, and listening to any changes in the model that might need refreshing the view happens in the controller!
A typical MVC interaction system

Few details of MVC:

  • The Model and the View only interact with the controller, and NEVER talk to each other directly. All communication happens via the Controller only.
  • As a result, the Controller usually becomes one massive class, handling multiple responsibilities.
  • All components are tightly coupled with each other. This makes reusability of these components difficult, replacing any of them later on, or making changes to them is a tough ask!
  • Writing tests and debugging intricate bugs in one massive controller class can be tricky.

MVVM

The following components form the main aspect of this pattern:
Model — The Model in MVVM works similar to MVC. It gives you the data you need, which can be present locally, or fetched from servers behind the scenes, just like in MVC.
View — Implemented as a View/View Controller subclass, the view here talks to the view model to gather all information, that is needed to display all UI components.
View Model — This is the major differentiating component from a MVC. The view model acts as the intermediate between the view and the model. Unlike MVC, the model is owned by View Model.
MVVM interaction system
Few details of MVVM:
  • The view here is a UIKit independent implementation. The view controller itself can be treated as the view component.
  • There’s complete isolation of the Model and the View, which makes them loosely coupled with one another.
  • The View Model invokes all changes to the model and listens to any changes that the Model makes behind the scenes.
  • The View and View Model interact via bindings, so any change in the Model notifies the View Model, which in turn updates the View.
  • This clearly helps break the massive controller of MVC, with the View and View Model now sharing responsibilities of updating UI and the coordination between components, respectively.

Discussion:

As we saw earlier, while MVC works for small contained components, it fails to meet the requirements of an evolving and growing product. Adding new code to an MVC system is difficult without breaking existing parts. Debugging issues in an MVC system can be time consuming, and sometimes can lead you clueless, as your controller is taking care of a million things at the same time.
While MVVM was great in taking care of some of those concerns, we thought there was still scope for some more modularity, some more scalability. We could do better! We could break these components into further subcomponents. The idea was to evolve the architecture in such a way that more and more components became reusable. It should be easier to replace one component without affecting the whole system.
So we went through these and a few more design patterns like VIPER, RIBs, evaluated their advantages/disadvantages, and compared them with our use case. We went through the common limiting factors encountered while scaling our systems. The final pattern we came up with was a hybrid version of the MVC and MVVM patterns.

Hybrid MVC and MVVM pattern

The following diagram shows the various components and their interaction within this pattern:
Let’s go over the functionalities of each of these:
  • Data Source — The Data Source is responsible for providing data to the entire system. This can be any generic class conforming to a protocol that is used by the Controller to ask for data. The data can be stored internally in any way. All that detail is internal to the implementation of Data Source. Conforming to a protocol ensures that we can replace the data source implementation without affecting any other component. All we need is for the new class to conform to the data source protocol, and we won’t have to change any other aspect. Given the Controller owns the Data Source, any changes in the underlying data are conveyed to the Controller that can then initiate appropriate action for it.
  • Controller — The controller is at the centre of it all though much of its responsibility is to coordinate other items to enable them to function together. Usually this is a View Controller subclass, which is initialised with a Data Source object. Suppose we have to implement a chat screen, which shows all messages and has ability to send messages. The main chat view controller will act as the Controller. The table view to show all messages would be a part of the chat view controller. The initialisation would look something like this:
Controller Initialisation
  • View — The independent UI components can be separated out in a separate View layer. The Controller instantiates and holds references to them.The View is passed as a View Model object that the View uses to populate itself. In case of our example, the cells of the table View can be initiated with this pattern, where we pass them a View model object to populate with:
View Initialisation
  • View Model — The View Model is instantiated by the Controller for the independent View components that need not be part of the Controller class. Identifying such View-View Model components can help keep your Controller light and code modular. The View Model is initialised with a Model object that contains all information needed by the view to populate itself. The other important aspect to it is that we don’t expose class names anywhere, we only expose id<some_protocol> type of objects. This makes it easier to replace these components without affecting any other components:
View Model Initialisation
  • Action Handler — The view reports all user actions taken on it back to the Controller. In order to keep the Controller independent of the business logic behind all such user actions, we place all this logic in a separate component called Action Handler. This component gets the information regarding the type of action (say single touch, long press etc.) from the Controller, and applies all business logic to handle that event:
Action Handler
It is important here to note that while the Action Handler has all the logic to execute in response to any user action, it doesn’t actually perform any UI operations itself. Any UI operation, be it adding/removing a subview, or pushing/presenting any other View Controller should only be done by the Controller. As we can see in the above snippet, the Action Handler returns a Response Model object. This object contains all information about the kind of UI task that needs to be performed:
Response Model
Based on the value of the action type, the Controller picks the appropriate UIView or UIViewController from the Response Model object and performs necessary operations on it. Thus, there is a clear separation of responsibility between the Controller and the Action Handler.

Conclusion:

This hybrid design pattern offers us multiple advantages over other patterns. When we applied it in app
  • Our Controller classes have become very light weight, with its only responsibility being that of connecting all other components together. This has improved the testability of this component
  • The Data Source kept the implementation of how data is stored abstracted, and this could be changed at any later point of time without affecting other components
  • The Views/ View Model become reusable as they were only identified by adhering to a protocol
  • Unit Testing becomes easier and could be done only for classes with a business logic in them.
  • Most if-else checks in the code were minimised by using factory pattern to link different components.
  • The readability of the code increased, helping other developers understand what’s going on in your features :)
Impact at Hike:
  • The architecture helped us improve the overall app stability. We started implementing it at one place at a time. We began with chat, and this helped us make chat more robust and easy to work upon. For instance, here’s how our app stability grew over time:
  • We were able to experiment internally with different versions of chat, as it was easy to just plug and play different components. This helped us make decisions faster.

Key takeaways:

  • The decision of choosing a design pattern will go a long way with you. Make sure you give enough thought to it
  • There are enough patterns out there, but you don’t have to necessarily choose from them. Feel free to come up with your own version based on your requirements

Thursday, October 11, 2018

Samsung Galaxy A9 (2018), the world's first smartphone with 4-inch rear camera launched


Samsung has launched the world's first-ever 4-rear camera smartphone Samsung Galaxy A9 (2018). The phone was launched at an event held in Malaysia's Kuala Lumpur on Thursday. The biggest feature of the Samsung Galaxy A9 (2018) is the launch of the Samsung Galaxy A9 (2018) 4 rear camera and has become the world's first smartphone with 4-rear camera. Let's tell you that the Galaxy A7 was launched with three rear cameras.
Samsung Galaxy A9 (2018) specification

This phone has the Android Orio 8.1 and 6.3-inch Full HD Plus Super Amoled display with dual SIM support. Apart from this, the phone will have Qualcomm Snapdragon 660 processor, up to 8 GB of RAM and 128 GB of storage.

Samsung Galaxy A9 is a 4-rear camera in 2019 with a 24-megapixel main lens, the second lens is a 10-megapixel telephoto with 2x optical zoom. The third lens is a 8-megapixel ultra wide angle lens and a fourth 5-megapixel lens. The four cameras are from the top down from the same line. The front has a 24-megapixel camera.

Samsung Galaxy A9 (2018) has a 3800 mAh battery that supports fast charging. There will be a fingerprint sensor in the phone's power button.
Price of Samsung Galaxy A9 (2018)

The price of Samsung Galaxy A9 (2018) is 599 euros, which is approximately Rs 51,300. However, there is still no explanation about how much Samsung Galaxy A9 (2018) will be worth in India. This phone will be available in Bubblegum Pink, Caver Black and Lemonade Blue Color Variants.

Saturday, March 3, 2018

HCL announces new solution to tap 5G market


Information Technology major HCL Technologies (HCL) on Friday announced a fully configurable, flexible 5G and mobile backhaul solution for Xilinx all programmable Zynq UltraScale+ MPSoC devices.
Xilinx Zynq UltraScale+ MPSoC devices offer the perfect single-chip platform for both cost-sensitive and high-performance applications using industry-standard tools.
These devices provide 64-bit processor scalability while combining real-time control with soft and hard engines for graphics, video, waveform, and packet processing.
It comes with multiple processor variants, a wide range of connectivity options and programmable logic capacity, DSP architectural blocks, and on-chip memory.
The solution targets 5G access and mobile backhaul markets and will enable telecom OEMs (original equipment manufacturers) to meet the stringent requirements of next-generation networks.
Integrated backhaul and access are among the key technologies needed to enable ambitious 5G demands. The increase in capacity of the 5G radio network needs to be supported by faster and wider bandwidth backhaul that incorporates Gigabit Ethernet, optical fiber, or microwave wired and wireless point-to-point links.
Xilinx is the leading silicon provider for wireless infrastructure for digital radio front end, connectivity, baseband acceleration, fronthaul and backhaul modem and packet processing functions. The programmability and scalability of Xilinx platforms make them an ideal fit for these applications, particularly for radio, where a variety of form factors, frequencies, bandwidths and radio access technologies need to be supported.
HCL’s solutions provide a range of benefits including enhanced radio performance, increased flexibility, and portability—along with other enhanced features. Together, the HCL and Xilinx integrated solution will provide a highly configurable backhaul modem on an advanced technology node (covering the spectrum of RF bands and E-bands, to V-bands) that will result in an overall reduction in bill-of-material (BOM) cost and a significant reduction in power dissipation compared to current solutions.
Additionally, the plug and play architecture allows for custom IP to be embedded in the modem.
“Telecommunications OEMs need enhanced capabilities for 5G, which is expected to power the growth of the mobile broadband, massive IoT, and mission-critical applications,” HCL Technologies Corporate Vice President Sukamal Banerjee said.

Saturday, February 24, 2018

Airtel and Huawei conduct 5G trial


In a major milestone for Indian telecom, Bharti Airtel and Huawei on Friday announced to have successfully conducted India’s first 5G network trial under a test set up.

The trial was conducted at Airtel’s state-of-the-art Network Experience Centre in Manesar (Gurgaon). The setup included 5G RAN operating on 3.5 GHz band, 5G Core and 50GE Network Slicing router.

During the test trial, a user throughput of more than 3 Gbps was achieved using the setup. This is the highest measured throughput for a mobile network in 3.5 GHz band with 100MHz bandwidth and end-to-end network latency of approximately 1 msec.

The setup demonstrates high spectral efficiency and potential for diversified services such as IoT and AR and VR, which can be delivered by 5G technology to serve a digitally connected world.

Bharti Airtel Director (Networks) Abhay Savargaonkar said, “This is small but a very significant step in our journey towards 5G. The promise of 5G is endless, it will be a game changer and,
it will change the way we live, work and engage. We’re moving quickly to begin collaboration towards 5G interoperability and development testing (IODT) based on the 3GPP R15 standards. .”

Interested for our works and services?
Get more of our update !