For a project I have to process a lot of information from a database and link it together. The information from the database is processed into Objects with attributes represented by information from the columns.
So far so good, but when I want to display this information to the user, I need to link the information from several objects together.
Now my question is, is it a good practice to make a new (dummy) Object with a few attributes from the other objects? A new Object that contains exactly the information I need at that moment? The information is difficult to fit into an ArrayList or Map, which was my first approach. The object can be discarded when no longer needed.
I try to make use of MVC Design Pattern, and I'm not really sure if this way of thinking fits MVC.
Sure it is. It is a design pattern known as Data Transfer Object. For more info, see this question : What is Data Transfer Object?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With