Help understanding this code:
DTO CLASS:
Repository class:
Dao class:
16 Replies
⌛
This post has been reserved for your question.
Hey @userexit! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Repository is supposed to handle the logic for accesses so for example not add an item thats already added in the list etc
Dao = data access object is supposed to do the physical job of adding, deleting, updating objects
Dto<K> is supposed to define a certain key of type K that an object will use for identification
lets say I have a studentclass that uses an integer as a key to identify a student
StudentDto extends Dto<Integer>
With this knowledge
the code:
means to try to add, remove, update elements from a data list of data transfer objects, I must specify the T = type of key, and a class that uses that key as an identificator
right ?
thats waht it means right ?
so
StudentRepository implements Repository<Integer, StudentDto>
with StudentDto extends Dto<Integer>
StudentDto extending Dto<Integer means he uses as a key an Integer
and here I say, hey StudentRepository is going to implement Repository and the key is an Integer, and the class that uses that key for identification is StudentDto
is this what it means ?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
noted
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
okay
and besides that is my understanding of this right ?
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
OI didnt write this codej ust trying to understand it
is it a functional interface
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
so this here replacs my Dto<K> class
T extends IdentityKey<K>
does this still work
when using interfaces
im asking because of extends keyword
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
alright I see
but besides that
my explanation of repository etc
was it
right
also since ur here
can u maybe explain this code
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
I didnt quite get this: PECS (provider extends, consumer super)
T here is a parent of Blarg
I can get that much
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.