Promoting SoC Through Application Layering

Creating a layered design in an application is a fundamental element of modern software architecture. The goal is to promote the Separation of Concerns (SoC) design principle. Separation of Concerns The ideas behind SoC date back to Dijkstra's 1974 paper "On the role of scientific thought" . In computer science, separation of concerns (sometimes abbreviated as SoC) is a design principle for separating a computer program into distinct sections. Each section addresses a separate concern, a set of information that affects the code of a computer program. A concern can be as general as "the details of the hardware for an application", or as specific as "the name of which class to instantiate". A program that embodies SoC well is called a modular program. Modularity, and hence separation of concerns, is achieved by encapsulating information inside a section of code that has a well-defined interface. - Wikipedia SoC is a broad design principal th...

Running React Native Apps on iPhone using Windows/Linux

Since X-Code is unavailable for Windows/Linux, it can be challenging to test a React Native application’s functionality for iOS on a Windows/Linux PC. One solution is to use Expo, an open-source platform that allows the app to run for iOS, Android, or the web. To use Expo to test the iOS version of the app, an iPhone is required. A VM could be used to test the application with X-Code and a non-Apple PC, but that’s beyond the scope of this article.

On the iPhone, install the Expo Go app (scan the QR code to download the app):

An account is required to access the features of the app, and can be created through the app or at https://expo.dev/signup.

Next, the latest LTS version of Node.js will need to be installed. Versions beyond the LTS version are more prone to errors when downloading packages.

In the console, verify both Node.js and npm have been installed:

node -v
npm -v

Optional: NVM (Node Version Manager) simplifies managing and changing node versions. If using Windows, NVM for Windows can be used instead, since NVM only works for Mac/Linux/WSL. For more details, see the README section included in each Github repository.

To install the latest LTS version of Node.js using NVM, run:

nvm install lts

Next, install Expo using NPM:

npm install expo-cli -g

After the install is completed, create a new React Native project:

npx create-expo-app@latest
Note: Templates can be used for new projects with different requirements.

Successful creation of a project should look like this, with no errors:

Now, start the server for the new application:

npx expo start
Note: The command "npx expo" has replaced "expo-cli", which is deprecated. Additionally, if facing any certificate errors with Powershell, try using Windows Terminal or Bash.

Once the server has been started, a QR code should show. Scan this with the iPhone to open the app for testing. For further guidance and troubleshooting, please explore the Expo documentation.