Training in Software Development With Java
Training in Software Development With Java
by
Vaishnavi Singh (171243)
I hereby declare that the work presented in this report in partial fulfillment of the
requirements for the award of the degree of Bachelor of Technology in Computer
Science and Engineering submitted in the department of Computer Science &
Engineering and Information Technology, Jaypee University of Information
Technology Waknaghat is an authentic record of my work carried out under the
supervision of Mr. Ujjawal Misra during the internship at ZopSmart.
The matter embodied in the report has not been submitted for the award of any other
degree or diploma.
This to certify that the above statement made by the candidate is true to the best of
my knowledge.
With great pleasure I avail this unique opportunity to express my profound sense of
gratitude and indebtedness to Mr. Ujjawal Misra, Consulting Architect at
ZopSmart, for his effective advice, perpetual and a never-ending supply of
motivation and constructive criticism during the course of the project. I would also
like to express my sincere gratitude to Mr. Nikhil R.S.S. and Mr. Shubham Joshi,
Senior Software Development Engineers at ZopSmart for guiding us throughout
the course of internship, and other developers of this project group for their help
rendered in completion of this project work. Additionally, I would like to thank Dr.
Pradeep Kumar Gupta(Associate Professor, JUIT) for consistently guiding me
during college on various projects.
I am also obliged to JUIT College and the staff members for the useful knowledge
they provide in their respective fields during the time of my assignment. I am
thankful for their cooperation.
Finally, I thank the Almighty for relentless support, our parents and our classmates,
without whom this task would not have been possible.
Table of Contents
CHAPTER 1 : INTRODUCTION
3.1 Findings
3.2 Conclusion and Future Scope
Abstract
ZopSmart is a retail technology company that offers all the resources needed to start
and develop your online store. It has a range of items that can rapidly and efficiently
inspire you to accomplish your objectives whether you are a traditional retailer
looking to develop an omni-channel market or perhaps an online only retailer
planning to develop an e-commerce business. It's solution is now in development
since last seven years and processes thousands of transactions nearly everyday.
Throughout the field of retail technology, our suite of products is among the most
innovative, robust, and scalable solutions available. It allows a vendor to create an e-
commerce website to handle their everyday business operations. Setting up own
website using our platform is indeed a helpful way to learn more about it. Users can
begin by including some items and banners to your site. A variety of themes are also
available to choose from. There is one programme that creates static websites. This
offers customers with a library of pre-built react modules with which one can pick
and customise. An entire website can be created using a drag-and-drop gui. You can
sign up once more if you haven't already. After a few minutes one should be able to
put that to the test. Many of the modifications take effect right away. All of our
knowledge has just been incorporated into market practises that become part of our
brands. To give consumers an excellent shopping experience with insightful product
search. For convenience of buying, it has created a personalised product catalog.
Self-service rescheduling and returns are available. The Enterprise portal is used by
two of India's biggest e-grocers to operate their online operations. The company
makes use of Java, Javascript, Golang, Android and numerous other technologies to
build products for retail. I did my training in the Java development field, this report
covers the work done during my training in ZopSmart.
CHAPTER 1 : INTRODUCTION
Four basic ecommerce structures which could be used to represent every other
exchange amongst businesses and customers.
4) Method of accepting yields: Order can be placed directly from the site.
Shopping carts also available on the websites of such businesses. One should click
the button and print out the shopping card to make a purchase for goods to be ordered,
and the E-Commerce firm can approve that as a client request or order.
5) Receiving funds in this manner: Purchasers are in close touch with one another
in conventional trade. Electronic money transfers, such as credit and debit cards,
smart cards, and e-checks, are used to accept transactions in E-Commerce. Payment
information is processed by Value Added Networks (VANS) and Payment Gateway
Systems, among other technologies.
6) Method for dealing with warranty coverage: If the product is faulty or has any
issues, it is often necessary to file a warranty petition. Warranty claims must be honoured
in this scenario, just as they will in a commercial environment.
7) Method of customer support: E-mail, online forms, online knowledge bases, and
commonly inquired questions are the core instruments of customer support.
In certain instances, online retailing can thrive not just because of the product, but
also because of its capable management staff, excellent after-sales facilities, well
organised corporate strategy, internet infrastructure, and a stable, excellently
designed website. A business that wishes to thrive would focus on two areas:
technical and operational aspects, as well as customer service. Market study and
review have been completed to a satisfactory level. E-commerce is not immune to
sound market strategy and production and consumption principles. Company loss is
as common in e-commerce as it is with any other industry.
Indeed there are hundreds of explanations for why the country or literally anyone
with network access, appears to be centering for e-commerce. Internet has benefits
like increased coverage and second lower cost of operating. Both of these advantages
will have a huge influence on the global market.
Stores on the internet get more exposure to a larger audience. Where a store online
might be reached and used by an unlimited internet users, a physical one can only
be accessible to local people. Several easiest channels to accomplish new
consumers using strength of internet usually involve:
The website, and hence e-commerce shop, remains open 24/7 a day, seven days
a week, apart from a regular shop, no limitations of geography. Customers will
have much more exposure to the shop as well as its offerings as a result of this.
E-commerce could also be reached from any location with internet
connectivity. Customers no longer have to drive to a place, which saves them
energy / cost.
2.1.1 Microservices
● Monolithic apps may become a "gelatinous blob of mud," in which neither one
programmer (or community of developers) seems to have a complete
understanding of the software.
● Only a small amount of recycle is possible through monolithic applications.
● Monolithic applications are notoriously difficult to scale.
● It's hard to sustain operating flexibility when deploying
monolithic programme objects over and over again.
● Monolithic programmes are defined by the use of a specific development layer
(for example, JEE or.NET), that may restrict the selection of "the best solution
for said purpose."
Services should then be scaled individually of all other services when they are
deployed as separate objects. Devs should use the best design process for tasks at
hand when developing programmes separately.
The uncertainty that comes with this versatility comes at a cost. Managing a large
number of connected services is difficult for many reasons:
● Working groups must be able to quickly identify resources that may be reused.
● Such programmes could provide manuals, testing systems, and other tools to
make reusing them much simpler than starting from scratch. The
interdependence of resources must be carefully supervised.
Agility - DevOps will concentrate just on upgrading the specific types of applications
by disintegrating features towards the most simple level and thereafter extracting the
associated resources which eliminates the time-consuming economic integration that
monolithic implementations are known for. Microservices shorten the production
time, allowing it to be completed in weeks rather than months.
Revenue - Quicker revisions and less downtime will boost sales. The incremental
updates provided by microservices enhance customer satisfaction and interaction.
2.2 Version Control
Devs can use version control to keep a record of and handle updates to a software
program's code. Version control becomes increasingly important as a software
project progresses. Consider WordPress-It is a fairly large project at this stage. This
wouldn't be secure or effective for a core programmer to modify the "official" source
code if they were to focus on a new aspect of WordPress codebase. Rather, version
control allows developers to securely divide and merge code. When a developer uses
branching, they duplicate a portion of its code base (called the repository). The
developer already can easily modify the section of the code without impacting the
entire project.
The reason is largely due to Java's long history of comprehensive testing, upgrading,
and distribution continuity. A devoted group of Software engineers, architects, and
pioneers have evaluated, enhanced, expanded, and validated Java. It has grown
steadily over the years despite and it's almost two-decade roots. It is developed to
enable the development of lightweight, high-performance software for the broadest
possible variety of computing technologies, thereby facilitating the fundamental
aspects of holistic availability and cross-platform engagement. Java has gained
considerable interest among developers because it allows them to:
2.3.1 JDBC
A standard that specifies a basic abstraction (API or Protocol) for java Software
applications to connect with different databases. It implements the Java database
functionality standard in the language. This is used to create applications that link to
databases. Databases and spreadsheets can be accessed using JDBC as well as the
database driver. JDBC APIs can be used to view business data contained in a
relational database (RDB). JDBC is an API (application programming interface) for
interacting with databases in Java programming. JDBC classes and interfaces enable
applications to submit user requests to a given database.
Figure 9: JDBC
The JDBC API's primary artefacts are:
The REST API, UNIX socketsor a network adapter are used by the Docker client and
daemon to connect. Docker Compose is yet another Docker client which allows one
to deal with apps made up of several containers. For example, developers write code
individually and then use Docker containers to sync it with teammates. They employ
Docker to deploy their software and run computerised testing in a testing
environment.
● Control - Deals with external feedback to the system that causes the model to
change. It's possible that the control and the view are connected (in the case of
a UI). Other external input (such as network commands) will, however, be
processed regardless of the vision. The controller acts as the application's
personal assistant, coordinating the model and display in order to fulfil an
user's query. When customers click on some GUI feature to execute an
operation, the customer's signal is approved as an HTTP get,post or any other
request. The main responsibility of a controller is to communicate with model
to manage the retrieval of just about any resources needed to operate. The
controller essentially tells the appropriate model for the mission at hand when
it receives a user order. Put simply the model is the data for programme. The
information is "modelled" in such a way that it is simple to store, access, and
modify.
While MVC in itself is a great design pattern, sometimes a layer other than the three
called as Service layer can be added to make it MVCS model. Why do we need a
Service layer when we can operate on data with Model itself? In general, the DAO
layer must be a light , with its main purpose being to get a link to database, which is
often abstracted so that separate database backends can be used around each other.
The service layer's aim would be to provide logic for processing data sent from and
to the DAO and client. These two components are sometimes combined into the same
module, and sometimes into the same code, but they are still seen as separate
logical entities. So the answer to the question is -
● Service layer ensures code modularity; business logic and guidelines are
defined in the service layer which further calls the DAO layer. Only
responsibility for DAO layer is to communicate with the database.
● Provides Security - If there is a service layer with no connection to the
database, gaining access to the database from the customer rather than via the
service becomes much more challenging. Any intruder who has taken control
of the client won't be able to access the info if database can't be reached directly
from the client (and there's no simple DAO component serving as the
service).
● Serves Loose Coupling - This may also be included in the program to provide
loose coupling. Let us just say a controller had 50 methods and it calls 20 Dao
methods. At some stage in the future plan to modify the Dao methods that serve
these controllers is made. Every 50 method in the controller must be modified.
Rather, if there are 20 service methods that call those particular 20 Dao
methods only 20 of them are required to be modified to refer toward a new
Dao.
Figure 13: Application flow diagram without service layer
REST is a mechanism that makes use of known protocols. Although REST can be
used for virtually any protocol, it is most commonly used with HTTP for Web APIs.
This suggests that in order to use a REST API architecture, programmers shouldn't
need to install any libraries or extra applications. It's noteworthy for its incredibly
flexible coating. REST can manage various kinds of calls, produce different formats
of data, and also modify architecturally with the proper application of hypermedia
when data is not bound to mechanisms and services.
What exactly is REST(Representational State Transfer) and what does it imply? Text
representations are transferred, accessed, and manipulated in a stateless fashion. It
offers consistent interoperability between different applications on the internet when
properly implemented. The word "stateless" is important because it enables systems
to interact with each other regardless of their state. A Uniform Resource Locator
(URL) is used to access a RESTful API function (URL). This rational naming
distinguishes the resource's identity from what is acknowledged or retrieved.
Developer side testing is highly vital for any application to obtain better results, and
today every reputable business company is doing it. It is not the task of a Quality
Assurance engineer; it is solely the responsibility of a Software engineer, and
Mockito is one of the most popular frameworks for it. It mocks the object as well as
the method that has to be tested. It is built on Java and makes use of annotations. It
involves creating false objects that act as though they are calling the real function,
and then comparing the actual result to the expected result supplied by the user. It's
a method of testing code coverage to determine how much of our code is covered
before releasing it, as well as to determine whether any code is included that isn't
helpful. In it, a false object is created with the same information as the real item, and
the user compares the outcome to the result supplied.
Mockito unit testing is completed by mocking the conditions for the classes under
test, followed by code execution. Approve the result after the code has been
performed to see if the taunting class restores a comparable reaction true to form or
not.
2.9.1 Authentication
● Depending on the role of the user different screens should be shown.
● Login onto the server is mandatory for the user before processing
any information further.
● Tokenization is used for authentication whenever any API call is made from
frontend to backend.
● This process generates a token which is dependent on the type of
user logged hitting any API.
2.9.3 Performance
● Caching is available for the user.
● To make the size of application not too heavy, optimisation over the
image is also implemented
● Management of Cookie
● To make the application up and running for all time and to protect it
from lagging, number of HTTP requests are reduced.
● Taking care of user information by encrypting it.
2.10 Non-Functional Requirements
2.10.1 Self Service
Many individuals used to have to travel to any official premises and wait a long time
for their application to be moved from one department to another, but this application
is a self-servicing platform that does not require any interaction with agents or
workers; just the validation is done by the company.
2.10.2 Responsiveness
Provides the best user experience and this is because of fast response and it provides
equal priority to every user
2.10.3 Accessibility
It provides maximum accessibility to its users and with this comes with the use of
minimum technical knowledge, this is accessible to every age member with ease.
Backend -
1. Java
2. Spring boot
3. PostgreSQL
4. REST API
5. Docker
Tools used -
1. IntelliJ
2. Swagger
3. Postman
4. Linux
5. Github
Unit testing is one of the most important activities that a developer should adopt and
practise; he or she should make it a rule that if the developer writes a piece of code,
he or she should also have his or her unit test code ready; this not only benefits the
user by allowing them to test it, but it also helps the developer if he or she decides
to include any code, making it easier for him or her to enforce his or her code.
Unit testing examines the code, and one of its most important properties is coverage.
The primary goal of unit testing is to ensure that each piece of code
functions as intended.
When a large function is written in a modular manner, each piece of code/method in
which it is broken is referred to as a unit.
It is very important as developer sees the proper execution of code and helps him to
debug the code. Tools used to unit test are -
1. Jtest
2. Junit
3. Mockito
❏ Either write the API manually or Import it in any format like text file, folder,
link or raw text of curl.
❏ If the API is of POST method then write request body in the provided column,
❏ “Headers can be given, by this postman acts as the browser running the API,
the difference is that it does not shows the html page as the result instead
shows the response data.”
❏ Postman supports multiple request methods like GET, POST, PUT, DELETE
etc.
In Portal, testing of every controller and service including all common helper
function is done and the code coverage of 95.7% came out of 100%. Whenever any
new piece of code is added then it can be tested immediately and precise areas of
concern cab be recognized by the developer.
Below is a list of errors that are frequently encountered while configuring a journey.
It contains a list of possible reasons that cause that error.
It may happen that the error occurs due to a reason not in the list. We will keep
updating as we come across more.
You can check these under Inspect : Network & Console
1. 500 : Something went wrong
Possible Reasons :
1. Error in Script task format
2. Field used in script task (Get Variable) or Service task is not defined before the
tasks are triggered
3. Error in service task format
4. Error in function/API that was called in service task
5. The ids used in script task or service task can be different compared to the field
ids used in forms
6. Server related error
7. API error in case the field has an API error
8. Mapping error in case an API has been triggered 9. Assignee or Task Id not
present in the User task
10. Assignee is incorrect.
11. Mapping of variables in a Decision Table
12. Boolean values such as TRUE/FALSE are defined as string
13. If the field is rest-input, make sure to add type : rest in the meta
3. 401
Possible Reasons :
1. Invalid token. The token could have expired
2. Invalid user credentials. Either credentials entered are incorrect or have not
been defined
4. TypeError: Cannot read property 'map' of null : This is mostly due to error in
javascript
Possible Reasons :
1. Script task error
2. Error in meta . For example the component dragged is text but form_type is
dropdown and no enums and options have been defined for the dropdown
3. The field expects an array but value is being saved in a different format
Although [3] states the kinds of errors we should narrow down our error codes to.
Status codes for your APIs when it comes to the relationship between an app and an
API, there are only three possible outcomes:
Generally 200 is OK, 400 is for Bad Request and 500 denotes Internal Server Error.
But [3] says if you’re If you're not comfortable reducing all your error conditions to
these 3, try picking among these additional 5:
● 201 - Created
● 304 - Not Modified
● 404 – Not Found
● 401 - Unauthorized
● 403 - Forbidden
CHAPTER 3: Conclusions
3.1 Findings
During the creation of this project, I learned a variety of skills, including how to
create clean code, how to build a database, many phases of web development,
backend development, system design concepts, Java, Spring framework, SQL, and
Rest APIs. Today's world is making enormous strides in web development, and now
is the time to act. Many large corporations are concentrating their efforts only on this
sector. Microservice architecture is superior to monolithic architecture in terms of
functionality and speed. This is because when a monolithic design architecture's
server fails, the entire product suffers, however this is not the case with
microservice architecture.
References
[1] https://betterexplained.com/articles/a-visual-guide-to-version-control/
[2] https://docs.docker.com/get-started/overview/
[3] https://pages.apigee.com/rs/apigee/images/api-design-ebook-2012-03.pdf