Let's consider a BookDAO class, for example, that needs to populate a list with every existing book. To my mind, this class belongs to the lowest layer (data access layer), but I've seen it as part of the middle layer (bussiness logic) too. Which of the above is correct?
In which layer do DAO classes belong in a 3-tier architecture of a web app?
442 Views Asked by AudioBubble At
1
There are 1 best solutions below
0
Suraj Mishra
On
- Keeping the DAO in the business layer has its own negative effect on the integrity of the system. One of the issues is the security of the data. APIs usually interact with the business logic. Mixing business logic and DAOs would give direct access to data to APIs.
- Imagine a situation where you need similar data for various operations in business logic. Keeping DAO in the data access layer would help in using the same data retrieval for both the operations.
Related Questions in JAVA
- I need the BIRT.war that is compatible with Java 17 and Tomcat 10
- Creating global Class holder
- No method found for class java.lang.String in Kafka
- Issue edit a jtable with a pictures
- getting error when trying to launch kotlin jar file that use supabase "java.lang.NoClassDefFoundError"
- Does the && (logical AND) operator have a higher precedence than || (logical OR) operator in Java?
- Mixed color rendering in a JTable
- HTTPS configuration in Spring Boot, server returning timeout
- How to use Layout to create textfields which dont increase in size?
- Function for making the code wait in javafx
- How to create beans of the same class for multiple template parameters in Spring
- How could you print a specific String from an array with the values of an array from a double array on the same line, using iteration to print all?
- org.telegram.telegrambots.meta.exceptions.TelegramApiException: Bot token and username can't be empty
- Accessing Secret Variables in Classic Pipelines through Java app in Azure DevOps
- Postgres && statement Error in Mybatis Mapper?
Related Questions in DATABASE
- How to add the dynamic new rows from my registration form in my database?
- How to store a date/time in sqlite (or something similar to a date)
- Problem with add new attribute in table with BOTO3 on python
- When an E-R attribute should be perceived as a relationship attribute or as an entity set attribute?
- SQLAlchemy: efficient relationship loading in 3-way many-to-many relationship
- Cannot connect to Postgres Database when running Quarkus Tests with Gitlab ci
- Local or remote database with react-native?
- I want to edit a specific row in database
- How to enter data in mongodb array at specific position such that if there is only 2 data in array and I want to insert at 5, then rest data is null
- Open Web Library
- database login.py and register.py error showing 404 file not found and doesn't work
- SQL71561: SqlComputedColumn: When column selected
- Liquibase as SaaS To Configure Multiple Database as Dynamic
- Updated max input vars but table still shows error
- Spring does not map set of roles
Related Questions in SERVLETS
- java ee jdbc jstl servlet connection to db
- IOException parsing XML document from ServletContext resource What throws this exception in my SpringBoot RESTweb service?
- How can i connect my 4 objects in my jsp file so it can run perfectly
- Best Practice to skip URL pattern's from getting applied servlet filter
- How to accurately replace scripts / html before saving data from servlet to database
- Servlet not displaying data obtained from dao
- flutter Multipart file upload server side error: Unable to process parts as no multi-part configuration has been provided
- Read an image file using okhttp3.RequestBody in java and send it to client using HTTPServletResponse
- Unexpected servlet config parameter contextConfigLocation=<NONE>
- The servlets named [ClassName] and [com.example.ClassName] are both mapped to the url-pattern [/ClassName] which is not permitted
- How to Use an External JAR Offline in a Maven Project for Servlets Without Internet Access?
- session.invalidate() is sometimes not working and not destroying the session object. What should I do?
- Database ConnectionError
- In a web.xml, can the url-pattern of servlet-mapping containing more than one path component? (e.g. /path/to/*))
- How to update the resource property using the valuemap in the Sling servlet?
Related Questions in DAO
- Too many arguments for public abstract fun in kotlin
- Springboot - The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)
- Sql query not return data
- One DAO per entity vs multiple DAO's per entity
- Detect corrupted Microsoft Access database in code-behind
- how to make a variable truly unmutable
- How to disconnect recordset obtained from local table in MS Access?
- DAO 3.6 missing in Visual Studio 2022 COM references
- In Microsoft Access VBA using DAO, how do you set a multivalued field when adding a record?
- Passing Event specific DAO's vs Generalised DAO's
- Room Database Errors
- Is it not possible to call a Dao-Room function passing the whole object as parameter rather than each member?
- DAO Design Pattern for multiple tables
- How to send DATE in Rest API in Post Method/Maven Project?
- Targer activity doesn't starts after clicking the button its navigate to main.activity
Related Questions in 3-TIER
- When Moving from .NET 4.x to .NET Core 7 should I change the UserManager class to a UserService and in Program.cs and do AddScoped<UserService> etc
- Should microservice have a tiered architecture, presentation, business, persistence and infrastructure for scalability? There are 10 microservices
- Handling nested objects in a 3-tier REST API
- 3 tiers architecture best practice using Spring Boot
- Using seperate layers for interfaces and DTO's
- How to avoid writing many functions that just call another function when implementing a Business Logic layer
- I do not know what is wrong with my function
- How do I publish a 3-tier WinForms application with database (.mdf)?
- NGINX configuration to forward request on to ALB
- Interaction within Business Logic Layer in 3-layered Architecture?
- Can I Return DTOs From DAL
- ASP.NET Core DI with Repository pattern (DAL, Service, Controller)
- SSL issue on 3 tier architecture
- Populate ComboBox (3 Tier Architecture)
- 3-tier architecture (Monolithic?) vs Microservices
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?