Mi Moire Hamza
Mi Moire Hamza
General information on
cross-platform
technologies
Chapter 01:General informationplatform technologies
Introduction:
In this section, I will begin by providing an overview of cross-platform
technologies and their importance in application development. We will
start by examining the cross-platform technology (.NET), which is an
integrated platform for developers consisting of tools, programming
languages, and libraries, enabling the building of diverse applications
including desktop, web, and mobile applications. Next, we will review Java
and PHP, two of the most prominent cross-platform technologies used
today, providing a brief explanation of each technology and its
importance in the development of software solutions. Finally, we will
cover the concept of cross-platform DBMSs and how to connect to them,
enabling efficient and sustainable data management across different
environments.
Definition:
Cross-platform technologies are one of the most important developments
in modern software development, as they aim to enable developers to
build applications that run on multiple operating systems using a single
code base. In the past, developing applications required creating a
separate version for each operating system, which meant duplicating
effort and time, in addition to additional costs to ensure that the
application runs efficiently on each platform. However, with the
development of cross-platform technologies, it has become possible to
develop a single application that can run on multiple operating systems
such as Windows, macOS, Android, and iOS [01].
Cross-platform technology(.NET) :
2
Chapter 01:General informationplatform technologies
1.1 Definition:
.NET is a developer platform made up of tools, programming languages, and libraries for
building many different types of applications.
There are various implementations of .NET. Each implementation allows .NET code to
execute in different places—Linux, macOS, Windows, iOS, Android, and many more.
.NET is a cross-platform implementation for running websites, services, and console apps
on Windows, Linux, and macOS. .NET is open source on GitHub. .NET was previously
called .NET Core.
Framework is the original implementation of .NET. It supports running websites,
services, desktop apps, and more on Windows.
.NET Standard is a formal specification of the APIs that are common across .NET
implementations. This allows the same code and libraries to run on different
implementations.[2]
1.2 Components of .Net Framework:
The two major components of .NET Framework are the Common Language Runtime and the
.NET Framework Class Library.[3]
1.2.1Common Language Runtime (CLR):
.Net Framework provides runtime environment called Common Language Runtime (CLR).It
provides an environment to run all the .Net Programs. The code which runs under the CLR is
called as Managed Code. Programmers need not to worry on managing the memory if the
programs are running under the CLR as it provides memory management and thread
management. Programmatically, when our program needs memory, CLR allocates the
memory for scope and de-allocates the memory if the scope is completed. Language
Compilers (e.g. C#, VB.Net, J#) will convert the Code/Program to Microsoft Intermediate
Language (MSIL) intern this will be converted to Native Code by CLR. See the below
Fig. [4]
1.2.1Figure01:CLS diagram
1.2.2 Framework Class Library (FCL):
This is also called as Base Class Library and it is common for all types of applications i.e. 3
Chapter 01:General informationplatform technologies
the way you access the Library Classes and Methods in VB.NET will be the same in C#, and
it is common for all other languages in .NET. The following are different types of
applications that can make use of .net class library.
Windows Application.
Console Application
Web Application.
XML Web Services.
Windows Services.
In short, developers just need to import the BCL in their language code and use its
predefined methods and properties to implement common and complex functions like
reading and writing to file, graphic rendering, database interaction, and XML document
manipulation. Below are the few more concepts that we need to know and understand as part
of this .Net framework. [5]
1.2.3.Common Type System (CTS):
It describes set of data types that can be used in different .Net languages in common. (i.e.),
CTS ensures that objects written in different .Net languages can interact with each other.
For Communicating between programs written in any .NET complaint language, the type
shave to be compatible on the basic level. The common type system supports two general
categories of types:
Value types:
Value types directly contain their data, and instances of value types are either allocated on
the stack or allocated inline in a structure. Value types can be built-in (implemented by
the runtime), user-defined, or enumerations.
Reference types:
Reference types store a reference to the value's memory address, and are allocated on the
heap. Reference types can be self-describing types, pointer types, or interface types. The
type of a reference type can be determined from values of self-describing types. Self-
describing types are further split into arrays and class types. The class types are user-
defined classes, boxed value types, and delegates. [6]
1.2.4. Common Language Specification (CLS):
It is a sub set of CTS and it specifies a set of rules that needs to be adhered or satisfied by all
language compilers targeting CLR. It helps in cross language inheritance and cross language
debugging. [7]
Common language specification Rules:
It describes the minimal and complete set of features to produce code that can be hosted by
CLR. It ensures that products of compilers will work properly in .NET environment.
Sample Rules:
Representation of text strings
Internal representation of enumerations
4
Chapter 01:General informationplatform technologies
Definition of static members and this is a subset of the CTS which all .NET languages
are expected to support.
Microsoft has defined CLS which are nothing but guidelines that language to follow
so that it can communicate with other .NET languages in a seamless manner.
Below mentioned the .Net Architecture stack for easy understanding. [8]
5
Following are the commonly used namespaces that contains useful classes and interfaces and
defined in Framework Class Library. [10]
Chapter 01:General informationplatform technologies
NamEspaces Description
It includes all common datatypes, string values,
System
arrays and methods for data conversion.
System.DataSystem.Data.Common,
These are used to access a database, perform
System.Data.OleDb, System.Data.SqlClient,
commands on a database and retrieve database.
System.Data.SqlTypes
System.IO,System.DirectoryServices,
These are used to access, read and write files.
System.IO.IsolatedStorage
It is used to debug and trace the execution of an
System.Diagnostics
application.
These are used to communicate over the Internet
System.Net, System.Net.Sockets
when creating peer-to-peer applications
These namespaces are used to create Windows-
System.Windows.Forms,
based applications using Windows user interface
System.Windows.Forms.Design
components.
System.Web,System.WebCaching, System.Web.UI,
System.Web.UI.Design,
System.Web.UI.WebControls, These are used to create ASP. NET Web
System.Web.UI.HtmlControls, applications that run over the web.
System.Web.Configuration, System.Web.Hosting,
System.Web.Mail, System.Web.SessionState
System.Web.Services,
System.Web.Services.Description,
These are used to create XML Web services and
System.Web.Services.Configuration,
components that can be published over the web.
System.Web.Services.Discovery,
System.Web.Services.Protocols
System.Security, System.Security.Permissions,
These are used for authentication, authorization, and
System.Security.Policy, System.WebSecurity,
encryption purpose.
System.Security.Cryptography
System.Xml,System.Xml.Schema,
These namespaces are used to create and access
System.Xml.Serialization, System.Xml.XPath,
XML files.
System.Xml.Xsl
6
Chapter 01:General informationplatform technologies
7
Chapter 01:General informationplatform technologies
When using ASP.NET your back-end code, such as business logic and data access, is written
using C#, F#, or Visual Basic. Because ASP.NET extends .NET, you can use the large
ecosystem of packages and libraries available to all .NET developers. You can also author
your own libraries that are shared between any applications written on the .NET platform.
[17]
10
Chapter 01:General informationplatform technologies
1.6.Java Technology:
Java Technology is a software platform used to develop and run various applications. It is
based on the Java programming language, which is a powerful and easy-to-use object-
oriented language. It was developed by Sun Microsystems (later acquired by Oracle) in
1995.. [20]
The main feature of Java is WORA. WORA stands for Write Once Run Anywhere. The
feature states that we can write our code once and use it anywhere or on any operating
system. Our Java program can run any of the platforms only because of the Java Virtual
Machine. It is a Java platform component that gives us an environment to execute java
programs. JVM’s main task is to convert byte code into machine code. [22]
JVM, first of all, loads the code into memory and verifies it. After that, it executes the code
and provides a runtime environment. Java Virtual Machine (JVM) has its own architecture,
which is given below:
11
Chapter 01:General informationplatform technologies
Figure09 diagram of Java Virtual Machine (JVM) has its own architecture
14
Chapter 01:General informationplatform technologies
In order to work with pipes and to read data from files, we need the io library. It
allows developers to use files in their Java applications.
The Nio is another library that stands for non-blocking I/O and is an alternative to
java.io library. By using it, we can get the advantage of intensive use of I/O
operations.
The math library is one of the libraries used for mathematical calculation, such as the
sum of Big Integer or Big Decimal.
In order to work with networks, connections, and sockets, java.net provides all the
required classes for it. The net library is mostly used for developing network
applications.
The swing and java.awt are two libraries used to create GUI(Graphical User
Interface). The java.awt is available in the older version of Java.
sound is another library that is used for media content.[27]
1.7.Java programming language:
1. Since Java is a free and versatile language, it can be used to build localized and
distributed software. Common uses of Java include : Java
2. Kotlin
3. Scala
4. Groovy
5. Clojure
6. JRuby
7. Jython
8. Fantom
9. Ceylon
10.Apache Groovy
11.Nashorn (JavaScript)
12.Processing[28]
15
software platform, that runs Java technology applications. An API is a collection of software
Chapter 01:General informationplatform technologies
components that you can use to create other software components or applications. Each Java
platform provides a virtual machine and an API, and this allows applications written for that
platform to run on any compatible system with all the advantages of the Java programming
language: platform-independence, power, stability, ease-of-development, and security.
Java SE:
When most people think of the Java programming language, they think of the Java SE
API. Java SE's API provides the core functionality of the Java programming language. It
defines everything from the basic types and objects of the Java programming language to
high-level classes that are used for networking, security, database access, graphical user
interface (GUI) development, and XML parsing.
In addition to the core API, the Java SE platform consists of a virtual machine,
development tools, deployment technologies, and other class libraries and toolkits
commonly used in Java technology applications.
Java EE:
The Java EE platform is built on top of the Java SE platform. The Java EE platform
provides an API and runtime environment for developing and running large-scale, multi-
tiered, scalable, reliable, and secure network applications.
Java ME :
The Java ME platform provides an API and a small-footprint virtual machine for running
Java programming language applications on small devices, like mobile phones. The API
is a subset of the Java SE API, along with special class libraries useful for small device
application development. Java ME applications are often clients of Java EE platform
services.
Java FX:
Java FX technology is a platform for creating rich internet applications written in Java FX
Script. Java FX Script is a statically-typed declarative language that is compiled to Java
technology bytecode, which can then be run on a Java VM. Applications written for the
Java FX platform can include and link to Java programming language classes, and may be
clients of Java EE platform services.[30]
1.10. PHP technology:
A PHP framework is a platform that provides developers with a set of tools and libraries to
build web applications more efficiently. It provides a structure for organizing code, handling
requests, and managing databases. PHP frameworks offer several benefits, including faster
development, improved performance, and excellent security. [31]
1.10. 1.Composer tools :
ComposerRequireChecker : A CLI tool to check whether a specific composer package
uses imported symbols that aren't part of its direct composer dependencies
composer-unused: Show unused composer dependencies by scanning your code
composer-normalize: Provides a composer plugin for normalizing composer. Json. [32]
16
Chapter 01:General informationplatform technologies
1.10. 2.PHP libraries and tools:
PHP possesses a rich ecosystem, with plenty of libraries and tools. Here is a list of them
that I consider interesting, beyond any framework. [33]
Libraries:
Nam spaces Description
brick/math Arbitrary-precision arithmetic library for PHP
Read and write spreadsheet files (CSV, XLSX and ODS),
openspout/openspout in a fast and scalable way
1.10. 2MySQL:
MySQL is the world’s most popular open-source database management
system. Databases are the essential data repositories for all software applications. For
example, whenever someone conducts a web search, logs into an account, or completes a
transaction, a database stores the information so it can be accessed in the future. MySQL
excels at this task. SQL, which stands for Structured Query Language, is a programming
language that’s used to retrieve, update, delete, and otherwise manipulate data in relational
databases. MySQL is officially pronounced “My ess-cue-El,” but “my sequel” is a common
variation. As the name suggests, MySQL is a SQL-based relational database designed to
store and manage structured data. In recent years, however, Oracle added additional support,
including for the popular JSON data type. [37]
1.10.connection method:
The International Standards for SQL define a standard high-level language for accessing and
manipulating data stored in a relational database. The standards for the SQL CLI define an
application programming interface (API) that programs use to issue standardized SQL
statements through a set of well-defined API functions. [40]
1.10.1 ODBC :
Open Database Connectivity (ODBC) is an open standard API that allows applications to
access various types of databases. Introduced in 1992 through a partnership between
Microsoft and Simba, the first ODBC driver (SIMBA.DLL) was developed, making it
possible to access data in databases such as SQL Server, MySQL, Oracle, and even flat file
databases. ODBC acts as a bridge between an application and the database by allowing the
use of standardized statements to interact with multiple database systems. Each database
requires a separate ODBC driver to communicate with it. This driver translates the ODBC
commands into database-specific commands, promoting versatility and simplifying system
integration.
ODBC Connection String Format:
The general format for an ODBC connection string is:
plaintext
Driver={Driver name}; Server=server name; Database=database name; User=username;
Password=password; Option=value;
Where:
Driver: Specifies the ODBC driver used to connect to a specific type of database (e.g., SQL
Server, MySQL). 19
Chapter 01:General informationplatform technologies
Server: The name or IP address of the database server.
Database: The name of the database to which you want to connect.
User: The username used to authenticate the connection.
Password: The password associated with the username.
Option: Additional configuration options for the connection, such as timeout settings or other
custom parameters.
2. Example 1: MySQL Connection String
Driver={Driver_name}; Server=server_name; Database=database_name; User=root;
Password=mot_de_passe; Option=3;
Explanation:
•Driver={Driver_name}: Specifies the ODBC driver for connecting to a database. You
would replace Driver_name with the specific MySQL ODBC driver, e.g., {MySQL ODBC
8.0 Driver}.
•Server=server_name: Indicates the hostname or IP address of the MySQL server (e.g.,
localhost or 192.168.1.100).
•Database=database_name: The name of the database you want to connect to (e.g., test_db).
•User=root: The username for authentication, here it's root, the default MySQL admin user.
•Password=mot_de_passe: The password for the user root.
•Option=3: A configuration option that can vary depending on the ODBC driver, such as
timeout settings or other preferences.
20
Chapter 01:General informationplatform technologies
21
Chapter 01:General informationplatform technologies
1.10.2 JDBC:
Java Database Connectivity (JDBC) is an API specification for connecting applications
written in Java to data in popular databases. The JDBC API lets you encode access request
statements in Structured Query Language (SQL) that are then passed to the application that
manages the database. It returns the results through a similar interface. [42]
JDBC Connection String for MySQL
Stringurl="jdbc:mysql://server_name:3306/database_name?
user=root&password=mot_de_passe&useSSL=false";
Explanation:
jdbc:mysql://: Specifies that you're using MySQL as the database type.
server_name: The hostname or IP address of the MySQL server (e.g., localhost or
192.168.1.100).
3306: The default port for MySQL (can be changed if a different port is used).
database_name: The name of the MySQL database you want to connect to (e.g.,
test_db).
user=root: The username for authentication (root is the default admin user).
password=mot_de_passe: The password for the user root.
22
Chapter 01:General informationplatform technologies
useSSL=false: Disables SSL encryption for the connection. You may set it to true for
secure connections.
23
Chapter 01:General informationplatform technologies
1.10.3 OLEDB :
OLEDB stands for Object Linking and Embedding Database. It is a Microsoft technology
that provides a standardized way to represent and work with data from different sources,
enabling applications to access and manipulate data in a consistent and efficient manner.
OLEDB is a Windows-only database API for accessing data in a variety of file formats
including any SQL-based data sources and relational databases (MySQL, MS-SQL, Oracle
etc.), as well as non-SQL-based data sources, such as directory services, XML spreadsheets,
emails on MS Exchange Server etc. The API provides a set of interfaces implemented using
component-based data access technology, Component Object Model (COM), which allows
applications to access data from these sources.
Microsoft initially developed OLE DB as a successor to the Open Database Connectivity
(ODBC) standard, extending its feature set to support a wider variety of non-relational
databases, such as object databases and spreadsheets. OLE DB is often used in combination
with other Microsoft technologies, such as ActiveX Data Objects (ADO) and Microsoft SQL
Server, to provide a comprehensive data access solution for Windows-based applications.
[43]
1. OLE DB Connection String for MySQL
Provider=MSDASQL; Driver={MySQL ODBC 8.0 Driver}; Server=server_name;
24
Database=database_name; Uid=root; Pwd=mot_de_passe;
Chapter 01:General informationplatform technologies
Explanation:
Provider=MSDASQL: Specifies the OLE DB provider for ODBC connections,
allowing OLE DB to use an ODBC driver for MySQL.
Driver={MySQL ODBC 8.0 Driver}: Specifies the ODBC driver for MySQL. Ensure
that the MySQL ODBC driver is installed on the system.
Server=server_name: The hostname or IP address of the MySQL server (e.g.,
localhost or 192.168.1.100).
Database=database_name: The name of the MySQL database you want to connect to
(e.g., test_db).
Uid=root: The username for authentication (e.g., root).
Pwd=mot_de_passe: The password for the user (mot_de_passe).
25
Chapter 01:General informationplatform technologies
Data Source=server_name\instance_name: The SQL Server hostname and instance
(e.g., localhost\SQLEXPRESS or 192.168.1.100\SQL2019).
Initial Catalog=database_name: The name of the SQL Server database (e.g., sales_db).
User ID=username: The SQL Server username for authentication (e.g., sa or another
user).
Password=password: The password associated with the SQL Server username.
26
Chapter 01:General informationplatform technologies
Conclusion:
In conclusion, cross-platform technologies are a mainstay of modern software
development, allowing developers to build solutions that can run on different
systems and environments. By looking at .NET, Java, and PHP, we can see how
flexible these technologies are in meeting the needs of different applications,
whether on the web, mobile devices, or desktop. In addition, cross-platform
database management systems enhance the efficiency of operations and provide
seamless communication between applications and data. Using these
technologies, developers can deliver innovative and versatile solutions that
efficiently meet the needs of modern businesses.
27