Post

Replies

Boosts

Views

Activity

Reply to Is DTO pattern in iOS really beneficial?
It depends on your app. If you have a complex app with different layers like services and repositories or DAOS implementing this pattern could be positive for you. You can hide your business logic and improve your memory usage not using data you don't need for example, you need to list users with his name, country, and telephone number, and your model classes are User { name : string, address: Address, telephone: Telephone} to list the information I. In the view, you don't need the address object with many parameters, only the country parameter. It is happening the same with the telephone object, you only need the number with no more parameters. The UserDTO was like this UserDTO{ name :String, country: String (Address.country), number:Strong(Telephone. number). With this code, you are hiding important data and saving computational costs.
Feb ’23