0% found this document useful (0 votes)
119 views

PL Project Scala

The document discusses a project to develop a hotel management system using the Scala programming language. The project is being undertaken by three students - Jawad Al-Turk, Abir Hariri, and Sarah Yousif - under the advisement of Dr. Islam El-kabani. Scala was chosen as the programming language due to its support for functional programming and strong static typing. The proposed system will allow for booking management, room management, customer management and other hotel management functions. Reasons for using Scala include its ability to use Java libraries, improved readability over Java, and functional programming features.

Uploaded by

Jawad Turk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

PL Project Scala

The document discusses a project to develop a hotel management system using the Scala programming language. The project is being undertaken by three students - Jawad Al-Turk, Abir Hariri, and Sarah Yousif - under the advisement of Dr. Islam El-kabani. Scala was chosen as the programming language due to its support for functional programming and strong static typing. The proposed system will allow for booking management, room management, customer management and other hotel management functions. Reasons for using Scala include its ability to use Java libraries, improved readability over Java, and functional programming features.

Uploaded by

Jawad Turk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Research Topic :Hotel Management System in Scala

Advisor: Dr. Islam El-kabani



Submitted by : Jawad Al-Turk- Abir Hariri- Sarah yousif



Programming languages Project
Project Members :
Jawad Al-Turk
Abir Hariri
Sarah yousif

Programming Language :
Scala
We picked this programming language since Scala is an object functional

programming and language for
general software applications. Scala has full support for functional
programming (including currying, pattern matching, algebraic data types, lazy evaluation, tail
recursion, immutability, etc.) and a very strong static type system. This allows programs written in Scala
to be very concise and thus smaller in size than most general purpose programming languages. Many of
Scala's design decisions were inspired by criticism over the shortcomings of Java.
Scala source code is intended to be compiled to Java byte code, so that the resulting executable code
runs on a Java virtual machine. Java libraries may be used directly in Scala code, and vice versa. Like
Java, Scala is statically typed and object-oriented, and uses a curly-brace syntax reminiscent of the C
programming language. Unlike Java, Scala has many features of functional programming languages
like Scheme, Standard ML and Haskell, including anonymous functions, type inference, list
comprehensions, and lazy initialization. Scala also has extensive language and library support for pattern
matching, delimited continuations, higher-order types, covariance and contra variance, and for
avoiding side-effects. Scala has a "unified type system", meaning that all types (including
primitive like integer and boolean) are subclasses of the type Any. This is similar to C# but unlike Java.
Scala likewise has other features present in C# but not Java, including anonymous types, operator
overloading, optional parameters, named parameters, raw strings, and no checked exceptions.
The name Scala is a portmanteau of "scalable" and "language", signifying that it is designed to grow with
the demands of its users
Scala is new generation JVM language, which is generating popularity as alternative of one of the most
popular language Java. It's not yet as popular as Java, but slowly getting momentum. As more and more
Java developers are learning Scala and inspired by Twitter, more and more companies are using Scala, its
future looks very bright. To start with, Scala has several good features, which differentiate it from Java,
but at the same time it has lot of similarities as well e.g. both Scala and Java are JVM based language, you
can code Scala in Java way and Scala can use any Java library. Since tremendous works has already been
done in form of open source framework and library in Java, it's best to reuse them, rather than creating
a separate set for Scala. One of the main differences between Scala and Java is its ability to take advantage
of Functional programming paradigm and multi-core architecture of current CPU. Since current
CPU development trend is towards adding more cores, rather than increasing CPU cycles, it also favors
functional programming paradigm. Apart from functional programming aspect, there are many other
differences as well. One of the obvious one is improved readability and succinct code. Java is always
on firing line for being too verbose, code which took 5 to 6 lines in Java, can be written in just 2 to 3 lines
in Scala.
Main idea of the Project:
Developing of Hotel management System using Scala Programming Language with Sql database
Proposed System:
The development of this new system contains the following activities, which try to automate
the entire process keeping in the view of database integration approach.
This system maintains users personal info, address, and contact details.
User friendliness is provided in the application with various controls provided by system rich
user interface.
This system makes the overall project management much easier and flexible.
Various classes have been used for maintaining the details of all the users and catalog.
Authentication is provided for this application. Only registered staff can access.
This system is providing more memory for the users to maintain data.
This system is providing accessibility control to data with respect to staff and managers.
System Features (Detailed description Of modules)
1. Login :
Each staff member should have a user name and password inorder to access the system
Existing user and existing hotel admin gets login and access the system components.

2. staff Registration:
New user or new hotel admin gets registered in database.
Admin gives details of registration.
3. make booking:
Employee should be allowed to add new booking with the info about the customer
4. booking management :
The employees should be allowed to edit the booking , delete them.
5. room management :
The employees should be allowed to add new rooms and manage them .
6. Customer management
The employees should be allowed to add new customer and manage or delete all the customers
available of the database.

The reason behind choosing Scala to develop this kind of software is :
Scala may provide a comfortable middle ground here, as it still operates on the JVM. This can allow Scala to play
nicely with many of the operational tooling and monitoring pieces that may already be in place for a business, making
a migration a far less risky proposition.
Scala also has a far greater potential for interoperability between itself and existing Java code. While many may
purport this to be seamless, the reality is a bit more complicated. Despite these issues, it can reliably be said that
Scala will likely play nicer with Java than many other languages.
The use of the JVM by Scala can also help to relieve any performance anxiety people may feel in migrating. It
generally performs on par with an equivalent Java program, so generally enterprise software shouldn't be stung by a
switch to Scala. Also Scala allows for use of most JVM libraries, that often become deeply embedded in enterprise
code. In this way, Scala can be a good hedge for the current Java-soaked business.
It is More Concise and Readable than Java
Scala shares many of the simple, readable syntax features of popular languages like Ruby. This is a feature that is
sorely lacking in Java and has untold impact on the workload of a development team in code maintenance. The
additional work required to understand and maintain existing Java code is a significant expense.
Additionally, the conciseness of Scala has a number of benefits. Scala can often be written in a fraction of the
number of lines required to write an equivalent function in Java. This has a productivity benefit in allowing developers
to do more functional work in a given workday. In addition, fewer lines of code makes for easier testing, code review
and debugging.

Functional Features

Scala makes use of a lot of functional syntactic sugar that has become popular with developers and makes
many developers characterize Scala as a more functional language. One example is pattern matching, allowing
for easy string comparisons. Another example is mixins, which allows functions to be included as part of a class
definition, which can save a lot of time by reusing code. Features like these are often attractive to developers,
particularly if they have become accustomed to their use in other non-Java environments.
Easy to Learn and "Exciting"
Scala's resemblance to currently popular languages like Ruby can be seen as an advantage, as its accessible
syntax makes it relatively easy to learn, particularly when compared to more convoluted languages like Java
and C++. The novelty and accessibility of the language have made it popular choice with a small, energized
group of developers.
This "excitement" shouldn't be underestimated, in fact it may be the biggest advantage of a move to Scala. The
reliability and age of Java make it a popular choice for the enterprise, but also attract developers of a specific,
somewhat risk-averse mindset. Languages like Scala can often attract highly energized developers that are
"language enthusiasts." These developers are often flexible, willing to try new things, innovative and highly
skilled. For many organizations, this could be just what is needed on a tech team.Whether or not Scala will see
a surge in popularity remains to be seen, as with any language it has its evangelists and detractors. The reality
is that a decision to move to Scala is an individual one, and heavily dependent on the environment. However,
the advantages listed above may shed some light on the situation, particularly for the Java dominated
enterprise.



10 reasons for considering the Scala programming language
Scala programming language has been around for a few years now and its popularity is increasing. Having
programmed in Java for many years, I was initially skeptical whether we needed another programming
language on the JVM. But after trying out Scala and reading about the language, I have had a change in heart.
Whether your background is Java, C/C++, Ruby, python, C# or any other language, Scala has some very
useful features that will force you to consider it, if you were looking for a programming language. This blog just
lists the useful features. Programming examples will follow in subsequent blogs.
1. Objected oriented programming language (OOP)
Scala is a object oriented programming language. The benefits of OOP are well documented. A majority of
programs today are written in some OO language. If you come from JAVA, C++, C# background, then you
already know the benefits. If you are currently using a language that is not OO, then this might be one of the
reasons for you to consider Scala. In Scala everything is an Object, unlike JAVA where primitives are not
objects and the use of static methods lets you bypass the OO paradigm. OO programming enables you to
write programs that have a structure that models that problem domain that the program is written for. This
helps produce programs that are easier to read and maintain.
2. Functional programming

In contrast to OO programming, functional programming encourages the use of functions to do some work
without changes in state or changes to the data it works on. Data is immutable. Functions take data as input
and may produce new data as output. Additionally, a function is a type just like an Integer, String or any class.
The advantage of functional programming is that there are no side effects - a function takes input and
produces output , that is all. This make it easy to write error free programs that can scale or can be executed
in parallel. Scala has very good support functional for programming.

3. Static Types

In statically typed languages like C++, Java and Scala, every variable has a type and the type
determines what the program can do with the variable. If you try to multiply 2 Strings, the compilation process
will flag that as error. Statically typed language protect the programmer
by detecting errors and from shooting himself in the foot. If you think strong typing is annoying and leads to
verbose code, then you will be pleased to know that unlike Java, Scala supports type inference ( ability to
detect type ) which reduces verbosity.

4. Brevity

Scala has features that enable the programmer to write compact code as opposed to verbose code. Less code
mean fewer bugs and less time spent on maintenance.

//Java
public class Person {
private String fname ;
private String lname ;

public Person(String first, String last) {
fname = first ;
lname = last ;
}

}

In Scala the same class is written as

class Person(fname: String,lname: String)

Scala supports type inference that helps avoid verbose code.

// Java String is in the statement twice
public String[] stringarray = new String[5] ;

// Scala type is infered as Array of Strings
val stringarray = new Array[String](5)

5. JVM language

Scala is compiled to bytecode that runs on the Java virtual machine. Since the JVM is available on every
platform, your scala code will run on windows , linux , mac os and any other platform for which a JVM is
available.
Another advantage is the integration with Java. Java has a very rich class library. There are several open
source projects that provide additional libraries for very useful functions. Java code can be called from Scala
programs very easily, which means all those function rich libraries are available for your use in Scala.

val calendar = new java.util.GregorianCalendar()
print(java.lang.String.format("%1$ty%1$tm%1$td",cal))
will print todays date in format YYMMDD.
6. Better support for concurrency

To write concurrent programs in JAVA, you had to deal with threads, the java memory model, locking
, synchronization, deadlocks etc. Writing error free concurrent programs was difficult. Scala has a actor based
programming model that shields the programmer from the issues you face in Java , C/C++. To write
concurrent programs , you implement actors that send, receive and handle messages. The Actor model lets
the programmer avoid sharing data between threads and the issues related to locking shared data.

7. Scalable programs

By avoiding locking in concurrent programs, Scala is able to exploit the parallelism in way that Java cannot. In
Java, a recommended best practice for writing scalable code was to use immutable objects. With the Actor
model is Scala, you use immutable objects as messages and have unsynchronized methods. Immutable
object are also at the heart of functional programming (2) which Scala promotes.

How many times have we heard of a Ruby or Python application that has be rewritten in Java or C++ because
it cannot scale to the increased demands of users ? With Scala, this will not be an issue.

8. Fast

Studies have shown that Scala is at least as fast as Java.
see http://research.google.com/pubs/pub37122.html

9. General purpose/multi-purpose

The brevity and compactness of Scale ensures that it can be used for scripting or rapid application
development a la Ruby or Python. But the fact that it runs on JVM and its scalability features ensure that it can
be used for complex applications.

10. It is getting more popular

This is a more non technical reason. Scala is getting more popular. More startups are moving to Scala. Many
are skipping Java and going directly to Scala. If you are a Java programmer, learning Scala makes you more
marketable. Even if you are not a Java programmer, learning Scala will open up a number of opportunities in
the programming world.

You might also like