SSH Q&A | FROM QUESTION TO PERFECTION| STUDY
WITH CONFIDENCE!
Course Code:
Course Title:
Programme:
Academic Year: 2026/2027
Duration: 2 Hours.
Total Marks: 70%.
Candidate Instructions:
1) Write your Registration Number on every answer booklet used.
2) Answer ALL questions in Section A and ANY TWO (2) questions in Section B.
3) Read each question carefully before answering.
4) Begin each question on a new page.
5) The marks for each question are indicated in brackets.
6) This paper consists of several printed pages, including this page.
7) Ensure your copy is complete before the examination begins.
8) Unauthorized materials and communication with other candidates are not permitted.
Turn Over.
APPHIA – Crafted with Care and Precision for Academic Excellence.
1
,What is Spring? Answer: Spring is an open source development framework for Enterprise Java.
Spring framework targets to make Java EE development easier to use and promote good
programming practice by enabling a POJO-based programming model.
What are benefits of Spring Framework? Answer: • Lightweight: Spring is lightweight when it
comes to size and transparency. The basic version of spring framework is around 2MB.
• Inversion of control (IOC): Loose coupling is achieved in Spring, with the Inversion of
Control technique. The objects give their dependencies instead of creating or looking for
dependent objects.
• Aspect oriented (AOP): Spring supports Aspect oriented programming and separates
application business logic from system services.
• Container: Spring contains and manages the life cycle and configuration of application objects.
• MVC Framework: Spring's web framework is a well-designed web MVC framework, which
provides a great alternative to web frameworks.
• Transaction Management: Spring provides a consistent transaction management interface that
can scale down to a local transaction and scale up to global transactions (JTA).
• Exception Handling: Spring provides a convenient API to translate technology-specific
exceptions (thrown by JDBC, Hibernate, or JDO) into consistent, unchecked exceptions.
Which are the Spring framework modules? Answer: • Core module• Bean module• Context
module• Expression Language module• JDBC module• ORM module• OXM module• Java
Messaging Service(JMS) module• Transaction module• Web module• Web-Servlet module•
Web-Struts module• Web-Portlet module
Explain the Core Container (Application context) module Answer: This is the basic Spring
module, which provides the fundamental functionality of the Spring framework. BeanFactory is
the heart of any spring-based application. Spring framework was built on the top of this module,
which makes the Spring container.
BeanFactory - BeanFactory implementation example Answer: A BeanFactory is an
implementation of the factory pattern that applies Inversion of Control to separate the
application's configuration and dependencies from the actual application code.The most
commonly used BeanFactory implementation is the XmlBeanFactory class.
XMLBeanFactory Answer: It loads its beans based on the definitions contained in an XML file.
This container reads the configuration metadata from an XML file and uses it to create a fully
configured system or application.
Explain the AOP module Answer: The AOP module is used for developing aspects for our
Spring-enabled application. Much of the support has been provided by the AOP Alliance in
APPHIA – Crafted with Care and Precision for Academic Excellence.
2
,order to ensure the interoperability between Spring and other AOP frameworks. This module
also introduces metadata programming to Spring.
Explain the JDBC abstraction and DAO module Answer: With the JDBC abstraction and DAO
module we can be sure that we keep up the database code clean and simple, and prevent
problems that result from a failure to close database resources. It provides a layer of meaningful
exceptions on top of the error messages given by several database servers. It also makes use of
Spring's AOP module to provide transaction management services for objects in a Spring
application.
Explain the object/relational mapping integration module Answer: Spring also supports for
using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM
module. Spring provides support to tie into several popular ORM frameworks, including
Hibernate, JDO, and iBATIS SQL Maps. Spring's transaction management supports each of
these ORM frameworks as well as JDBC.
Explain the web module Answer: The Spring web module is built on the application context
module, providing a context that is appropriate for web-based applications. This module also
contains support for several web-oriented tasks such as transparently handling multipart
requests for file uploads and programmatic binding of request parameters to your business
objects. It also contains integration support with Jakarta Struts.
Explain the Spring MVC module Answer: MVC framework is provided by Spring for building
web applications. Spring can easily be integrated with other MVC frameworks, but Spring's
MVC framework is a better choice, since it uses IoC to provide for a clean separation of
controller logic from business objects. With Spring MVC you can declaratively bind request
parameters to your business objects.
Spring configuration file Answer: Spring configuration file is an XML file. This file contains
the classes information and describes how these classes are configured and introduced to each
other.
What is Spring IoC container? Answer: The Spring IoC is responsible for creating the
objects,managing them (with dependency injection (DI)), wiring them together, configuring
them, as also managing their complete lifecycle.
What are the benefits of IOC? Answer: IOC or dependency injection minimizes the amount of
code in an application. It makes easy to test applications, since no singletons or JNDI lookup
mechanisms are required in unit tests. Loose coupling is promoted with minimal effort and least
intrusive mechanism. IOC containers support eager instantiation and lazy loading of services.
What are the common implementations of the ApplicationContext? Answer: The
FileSystemXmlApplicationContext container loads the definitions of the beans from an XML
file. The full path of the XML bean configuration file must be provided to the constructor. The
ClassPathXmlApplicationContext container also loads the definitions of the beans from an
XML file. Here, you need to set CLASSPATH properly because this container will look bean
APPHIA – Crafted with Care and Precision for Academic Excellence.
3
, configuration XML file in CLASSPATH. The WebXmlApplicationContext: container loads the
XML file with definitions of all beans from within a web application.
What is the difference between Bean Factory and ApplicationContext? Answer: Application
contexts provide a means for resolving text messages, a generic way to load file resources (such
as images), they can publish events to beans that are registered as listeners. In addition,
operations on the container or beans in the container, which have to be handled in a
programmatic fashion with a bean factory, can be handled declaratively in an application
context. The application context implements MessageSource, an interface used to obtain
localized messages, with the actual implementation being pluggable.
What does a Spring application look like? Answer: • An interface that defines the functions.•
The implementation that contains properties, its setter and getter methods, functions etc., •
Spring AOP • The Spring configuration XML file. • Client program that uses the function
What is Dependency Injection in Spring? Answer: Dependency Injection, an aspect of
Inversion of Control (IoC), is a general concept, and it can be expressed in many different
ways.This concept says that you do not create your objects but describe how they should be
created. You don't directly connect your components and services together in code but describe
which services are needed by which components in a configuration file. A container (the IOC
container) is then responsible for hooking it all up.
What are the different types of IoC (dependency injection)? Answer: • Constructor-based
dependency injection: Constructor-based DI is accomplished when the container invokes a class
constructor with a number of arguments, each representing a dependency on other class.
• Setter-based dependency injection: Setter-based DI is accomplished by the container calling
setter methods on your beans after invoking a no-argument constructor or no-argument static
factory method to instantiate your bean.
Which DI would you suggest Constructor-based or setter-based DI? Answer: You can use both
Constructor-based and Setter-based Dependency Injection. The best solution is using constructor
arguments for mandatory dependencies and setters for optional dependencies.
What are Spring beans? Answer: The Spring Beans are Java Objects that form the backbone of
a Spring application. They are instantiated, assembled, and managed by the Spring IoC
container. These beans are created with the configuration metadata that is supplied to the
container, for example, in the form of XML <bean/> definitions. Beans defined in spring
framework are singleton beans. There is an attribute in bean tag named "singleton" if specified
true then bean becomes singleton and if set to false then the bean becomes a prototype bean. By
default it is set to true. So, all the beans in spring framework are by default singleton beans.
What does a Spring Bean definition contain? Answer: A Spring Bean definition contains all
configuration metadata which is needed for the container to know how to create a bean, its
lifecycle details and its dependencies.
APPHIA – Crafted with Care and Precision for Academic Excellence.
4
WITH CONFIDENCE!
Course Code:
Course Title:
Programme:
Academic Year: 2026/2027
Duration: 2 Hours.
Total Marks: 70%.
Candidate Instructions:
1) Write your Registration Number on every answer booklet used.
2) Answer ALL questions in Section A and ANY TWO (2) questions in Section B.
3) Read each question carefully before answering.
4) Begin each question on a new page.
5) The marks for each question are indicated in brackets.
6) This paper consists of several printed pages, including this page.
7) Ensure your copy is complete before the examination begins.
8) Unauthorized materials and communication with other candidates are not permitted.
Turn Over.
APPHIA – Crafted with Care and Precision for Academic Excellence.
1
,What is Spring? Answer: Spring is an open source development framework for Enterprise Java.
Spring framework targets to make Java EE development easier to use and promote good
programming practice by enabling a POJO-based programming model.
What are benefits of Spring Framework? Answer: • Lightweight: Spring is lightweight when it
comes to size and transparency. The basic version of spring framework is around 2MB.
• Inversion of control (IOC): Loose coupling is achieved in Spring, with the Inversion of
Control technique. The objects give their dependencies instead of creating or looking for
dependent objects.
• Aspect oriented (AOP): Spring supports Aspect oriented programming and separates
application business logic from system services.
• Container: Spring contains and manages the life cycle and configuration of application objects.
• MVC Framework: Spring's web framework is a well-designed web MVC framework, which
provides a great alternative to web frameworks.
• Transaction Management: Spring provides a consistent transaction management interface that
can scale down to a local transaction and scale up to global transactions (JTA).
• Exception Handling: Spring provides a convenient API to translate technology-specific
exceptions (thrown by JDBC, Hibernate, or JDO) into consistent, unchecked exceptions.
Which are the Spring framework modules? Answer: • Core module• Bean module• Context
module• Expression Language module• JDBC module• ORM module• OXM module• Java
Messaging Service(JMS) module• Transaction module• Web module• Web-Servlet module•
Web-Struts module• Web-Portlet module
Explain the Core Container (Application context) module Answer: This is the basic Spring
module, which provides the fundamental functionality of the Spring framework. BeanFactory is
the heart of any spring-based application. Spring framework was built on the top of this module,
which makes the Spring container.
BeanFactory - BeanFactory implementation example Answer: A BeanFactory is an
implementation of the factory pattern that applies Inversion of Control to separate the
application's configuration and dependencies from the actual application code.The most
commonly used BeanFactory implementation is the XmlBeanFactory class.
XMLBeanFactory Answer: It loads its beans based on the definitions contained in an XML file.
This container reads the configuration metadata from an XML file and uses it to create a fully
configured system or application.
Explain the AOP module Answer: The AOP module is used for developing aspects for our
Spring-enabled application. Much of the support has been provided by the AOP Alliance in
APPHIA – Crafted with Care and Precision for Academic Excellence.
2
,order to ensure the interoperability between Spring and other AOP frameworks. This module
also introduces metadata programming to Spring.
Explain the JDBC abstraction and DAO module Answer: With the JDBC abstraction and DAO
module we can be sure that we keep up the database code clean and simple, and prevent
problems that result from a failure to close database resources. It provides a layer of meaningful
exceptions on top of the error messages given by several database servers. It also makes use of
Spring's AOP module to provide transaction management services for objects in a Spring
application.
Explain the object/relational mapping integration module Answer: Spring also supports for
using of an object/relational mapping (ORM) tool over straight JDBC by providing the ORM
module. Spring provides support to tie into several popular ORM frameworks, including
Hibernate, JDO, and iBATIS SQL Maps. Spring's transaction management supports each of
these ORM frameworks as well as JDBC.
Explain the web module Answer: The Spring web module is built on the application context
module, providing a context that is appropriate for web-based applications. This module also
contains support for several web-oriented tasks such as transparently handling multipart
requests for file uploads and programmatic binding of request parameters to your business
objects. It also contains integration support with Jakarta Struts.
Explain the Spring MVC module Answer: MVC framework is provided by Spring for building
web applications. Spring can easily be integrated with other MVC frameworks, but Spring's
MVC framework is a better choice, since it uses IoC to provide for a clean separation of
controller logic from business objects. With Spring MVC you can declaratively bind request
parameters to your business objects.
Spring configuration file Answer: Spring configuration file is an XML file. This file contains
the classes information and describes how these classes are configured and introduced to each
other.
What is Spring IoC container? Answer: The Spring IoC is responsible for creating the
objects,managing them (with dependency injection (DI)), wiring them together, configuring
them, as also managing their complete lifecycle.
What are the benefits of IOC? Answer: IOC or dependency injection minimizes the amount of
code in an application. It makes easy to test applications, since no singletons or JNDI lookup
mechanisms are required in unit tests. Loose coupling is promoted with minimal effort and least
intrusive mechanism. IOC containers support eager instantiation and lazy loading of services.
What are the common implementations of the ApplicationContext? Answer: The
FileSystemXmlApplicationContext container loads the definitions of the beans from an XML
file. The full path of the XML bean configuration file must be provided to the constructor. The
ClassPathXmlApplicationContext container also loads the definitions of the beans from an
XML file. Here, you need to set CLASSPATH properly because this container will look bean
APPHIA – Crafted with Care and Precision for Academic Excellence.
3
, configuration XML file in CLASSPATH. The WebXmlApplicationContext: container loads the
XML file with definitions of all beans from within a web application.
What is the difference between Bean Factory and ApplicationContext? Answer: Application
contexts provide a means for resolving text messages, a generic way to load file resources (such
as images), they can publish events to beans that are registered as listeners. In addition,
operations on the container or beans in the container, which have to be handled in a
programmatic fashion with a bean factory, can be handled declaratively in an application
context. The application context implements MessageSource, an interface used to obtain
localized messages, with the actual implementation being pluggable.
What does a Spring application look like? Answer: • An interface that defines the functions.•
The implementation that contains properties, its setter and getter methods, functions etc., •
Spring AOP • The Spring configuration XML file. • Client program that uses the function
What is Dependency Injection in Spring? Answer: Dependency Injection, an aspect of
Inversion of Control (IoC), is a general concept, and it can be expressed in many different
ways.This concept says that you do not create your objects but describe how they should be
created. You don't directly connect your components and services together in code but describe
which services are needed by which components in a configuration file. A container (the IOC
container) is then responsible for hooking it all up.
What are the different types of IoC (dependency injection)? Answer: • Constructor-based
dependency injection: Constructor-based DI is accomplished when the container invokes a class
constructor with a number of arguments, each representing a dependency on other class.
• Setter-based dependency injection: Setter-based DI is accomplished by the container calling
setter methods on your beans after invoking a no-argument constructor or no-argument static
factory method to instantiate your bean.
Which DI would you suggest Constructor-based or setter-based DI? Answer: You can use both
Constructor-based and Setter-based Dependency Injection. The best solution is using constructor
arguments for mandatory dependencies and setters for optional dependencies.
What are Spring beans? Answer: The Spring Beans are Java Objects that form the backbone of
a Spring application. They are instantiated, assembled, and managed by the Spring IoC
container. These beans are created with the configuration metadata that is supplied to the
container, for example, in the form of XML <bean/> definitions. Beans defined in spring
framework are singleton beans. There is an attribute in bean tag named "singleton" if specified
true then bean becomes singleton and if set to false then the bean becomes a prototype bean. By
default it is set to true. So, all the beans in spring framework are by default singleton beans.
What does a Spring Bean definition contain? Answer: A Spring Bean definition contains all
configuration metadata which is needed for the container to know how to create a bean, its
lifecycle details and its dependencies.
APPHIA – Crafted with Care and Precision for Academic Excellence.
4