I’m working on a project where I’m thinking about using a simple model class as a frontend for a DAO (Data Access Object) that uses JDBC without any ORM (Object-Relational Mapping). The thing is, this model class wouldn’t have any attributes of its own. It would just pass information from the DAO to the frontend.
I’m not sure if this is a good way to do things. Has anyone tried this before? What problems might pop up if I go this route? And if it’s not a great idea, how should I design my class instead to make sure everything works smoothly?
I’m pretty new to working with DAOs and databases, so any advice would be super helpful. Thanks in advance for your input!
Using a model class as a frontend for a DAO without attributes is generally discouraged because it mixes the responsibilities of data storage and presentation. In my experience, separating these concerns by designing a model class that accurately reflects the database structure leads to better maintainability and less ambiguity in code. This approach simplifies debugging and future expansion, since it provides a clear boundary between data handling and business logic. Adopting this separation can be especially beneficial when dealing with complex projects over the long term.
hmm, interesting idea! have u thought about how this might affect scalability? what if u need to add more complex operations later? maybe we could brainstorm some alternative approaches? I’m curious to hear more about your project goals - care to share some details?
hey there! i’ve tried smthing similar before. it might work for small projects, but it can get messy real quick. maybe consider adding some basic attributes to ur model class? it’ll make life easier down the road, trust me. plus, it helps keep things organized when ur project grows. just my two cents!