Siriquelle posted to #Classroom:

Siriquelle

Anyone got a working solution to updating a note in the programming assignment?

12 months ago.

8 comments so far

  • Adventsparky

    Didn't you say you had one the other day?

    12 months ago by Adventsparky

  • Siriquelle

    The LectureNote interface doesn't allow for the creation of a new full message, like, you can't set any data in the note you want to update so you have to create a new note with the updated data, and remove the old one, new note means new id, true updating, like in database updating would allow you to keep the old id, this way links to the updated lecture note wouldn't brake when the update happens, d'ya know what I mean? Kudos if you can discover a solution for this, I just hope it's not blindingly obvious, don't want to get in a red face situation,

    12 months ago by Siriquelle

  • harrisireland

    Can you not just keep the same id and change the content by setting the content in the update method?

    12 months ago by harrisireland

  • Siriquelle

    @harrisireland: the LectureNote interface doesn't have a set method, as far as I know without a set method for all the other data or even just one for the Id the id will need to be new every time. Unless we change the interface, Don't think we're aloud to do that though, it's a doozie,

    11 months, 4 weeks ago by Siriquelle

  • Siriquelle

    @harrisireland: looking at it again there, i thought id got it, but while the updateNote in the NoteBook does allow you to create a new LectureNote but it will only take in a LectureNote as an argument, which needs to be created in the controller before it gets passed to the NoteBook, and so dilemma one kicks in with the no set method in LectureNote to update the id with the previous one,

    11 months, 4 weeks ago by Siriquelle

  • Siriquelle

    @harrisireland: damn, just got it, you were right,

    11 months, 4 weeks ago by Siriquelle

  • harrisireland

    Really I am? I just had a guess haven't even started it yet. I can remember that JHannifin said we would have to add set methods to the interfaces or where ever needed

    11 months, 4 weeks ago by harrisireland

  • Siriquelle

    delete the old note - before returning form that delete method set the note id to a new variable - create a new note with the updated stuff - pass that note to the update method - get the old note id set before - create a new note from the updated stuff and the old note id - and then add that note to the fecken notebook - This is how I did it - please let me know of any other way of doing this,

    11 months, 4 weeks ago by Siriquelle

Sign in to add a comment