Client - Server Patterns

Client-Server is a common architecture pattern in software systems. It is a distributed system architecture that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. There are different patterns in which client and server can communicate with each other. Request-Response The client sends a request to the server and waits for a response. The server processes the request and sends a response back to the client....

Testing - Finding Errors Early

Errors in software systems are inevitable. They can be caused by a variety of factors, including human error, hardware failure, or software bugs. Testing a software helps in finding errors early, It is important to find errors as early as possible to avoid any sort of issues in production. Let’s explore some checkpoints in which errors can be found early. Build Time Compiler performs a syntax check on the code and reports any errors....

Bash - Overview

Bash Scripting is a handy and powerful tool for automating tasks on a Unix-like operating system. It is a command language interpreter that executes commands read from the standard input or from a file. Bash also incorporates useful features from the Korn and C shells (ksh and csh). Variables Variables in Bash are used to store data. They can be used to store strings, numbers, and other types of data. Variables are defined using the = operator....

API Patterns

API is a common concept among software systems. Different software systems require to communicate with eachother to invoke some functionality or to exchange data. Since it’s a frequent requirement, it’s important to have a set of standards. There are different patterns and best practices that can be used to design and implement APIs. RESTful API REST APIs are designed around resources, which are any kind of object, data, or service that can be accessed by the client....

Razor Pages - Overview

Razor pages provides a way to build web applications using a page-focused approach. Under the hood, it uses the same routing and middleware as MVC, and it provides directory-based conventions for views. Pages can have a viewmodel where we can define page data and actions. Pages: Pages are the main part of a Razor Pages application. Pages are created in the Pages directory and are named with the .cshtml extension. Each page can have a corresponding ....

Dotnet MVC - Overview

C# asp.net MVC is a web application framework that provides a model-view-controller architecture. The MVC pattern separates the application into three main components: the model, the view, and the controller. This separation of concerns makes it easier to manage and maintain the application. This structure also makes it easier to test and debug the application. Model: The model represents the data and core business logic related to data of the application....

Scala - Testing

Scala supports testing using the JUnit and ScalaTest frameworks. These frameworks provide a way to write and run tests for your Scala code. JUnit is a popular choice for unit testing in Scala due to its simplicity and extensibility. Writing Tests JUnit provides a set of annotations that can be used to write tests. The @Test annotation is used to mark a method as a test method. The @Before and @After annotations are used to mark methods that should be run before and after each test method, respectively....

Rust - Testing

Rust has built-in support for testing with the cargo and assert. We can write tests in Rust using the #[test] attribute and the assert! macro. The cargo command-line interface can be used to run the tests. The tests can be written in the same file as the code being tested, or in a separate file. Writing Tests Suppose we have a function add in main.rs which adds two numbers. // main....

Python - Testing

Python unittest library is a built-in library that provides a way to write and run tests for your Python code. It is a part of the Python standard library and is widely used for writing unit tests in Python. pytest is another popular choice for testing in Python due to its simplicity and extensibility. Writing Tests unittest provides a set of classes and methods that can be used to write tests....

Kotlin - Testing

Writing tests in Kotlin can be done using the JUnit and KotlinTest frameworks. These frameworks provide a way to write and run tests for your Kotlin code. JUnit is a popular choice for unit testing in Kotlin due to its simplicity and extensibility. Writing Tests JUnit provides a set of annotations that can be used to write tests. The @Test annotation is used to mark a method as a test method....