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

DAO

Design

Uploaded by

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

DAO

Design

Uploaded by

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

Data Access Object Design Pattern

(Interview Questions 2)

What is Data Access Object in Java? And where you have used it in
your automation Framework?
• In Java, a DAO (Data Access Object) is a design pattern that provides an abstract
interface for accessing data from a database.
• It separates the logic for retrieving and storing data from the business logic of the
application.
• This separation of concerns helps to improve the maintainability and flexibility of
the application.

Usage:
• A DAO typically consists of a set of methods that correspond to common database
operations, such as reading, inserting, updating, and deleting records
• These methods typically take arguments that correspond to the data being
manipulated, and they return results that indicate the success or failure of the
operation.
• In your Test Automation Framework you are interested only in the Reading
Operation.

1
Test Automation Academy Jatin Shharma
Drawback Of DAO:
• There are a few potential drawbacks to using a DAO design pattern in Java.
• Increased complexity:
o Adding a DAO layer to an application can increase the overall complexity of the
codebase, as it adds another layer of abstraction.
o This can make it more difficult to understand and debug the application.

• Performance overhead: Using a DAO can add a small amount of performance overhead
to an application, as it requires additional method calls and object creation

• Limited flexibility:
o A DAO may provide a fixed set of methods that correspond to common database
operations, but it may not be able to handle more complex or specialized queries.

• Tight coupling with the database:


o A DAO is tightly coupled with the database implementation, which can make it
difficult to switch between different database technologies or configurations.
o This can limit the flexibility of the application and increase the cost of maintenance.

2
Test Automation Academy Jatin Shharma
Where to Use DAO in your Test Automation Framework?

DAO is component will only be used for DB validation.

Example:

o Where the user records have been updated properly by UI or API automation
o Verify if the Dropdowns are populated correctly on the UI

3
Test Automation Academy Jatin Shharma

You might also like