Created
April 15, 2017 20:06
-
-
Save RuiAAPeres/640c1bb3f005edfe9f1980cd8849eb57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyModelDTO { | |
let property1: Type1 | |
let property2: Type2 | |
} | |
extension MyModelDTO { | |
init(model: MyModel_CoreData) { | |
self.init(property1: model.property1, property2: model.property2) | |
} | |
} | |
class MyModel_CoreData: NSManagedObject { | |
@NSManaged var property1: Type1 | |
@NSManaged var property2: Type2 | |
} |
DTO
means Data Transfer Object
(as you probably know). I use the suffix when in situations where the naming of the entity is not entirely clear that it's just a dumb struct carrying data.
Makes sense 👍 Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @RuiAAPeres, what's the meaning behind a DTO suffix?