Giter VIP home page Giter VIP logo

Comments (10)

mickhansen avatar mickhansen commented on May 26, 2024 1

No software should be broken, if a method was removed i'm sure it happened under a semver major release. However i don't recall exactly when it was removed as i haven't been a maintainer for a long while.

from botserver.

mickhansen avatar mickhansen commented on May 26, 2024 1

save() is used to save whatever properties have been modified via set (or direct access).

and .update({...}) is a DIRECT replacement for .updateAttributes({...}) ?

I believe so, but it's probably been 2 years or more since i did work on Sequelize.
I recall updateAttributes proxying to update

from botserver.

chornbe avatar chornbe commented on May 26, 2024

Why?
Is updateAttributes broken in some way?
Is the functionality in update superior?
If so, what differences are there?
If so, why not turn updateAttributes into an API compliant wrapper around update so people don't have to update (pun!) potentially thousands of lines of code in a complex system.

Rule #1 of API development - don't change your published API, instead version it and leave the old stuff alone, or compliance-wrap it so it all boils down to calling only the new code. :\

Microsoft pissed off a LOT of developers in the 90s by changing the ActiveX ADO libraries between version 2.0 and 2.1 without leaving any clean migration path. Since ADO is updated with system updates and not by developer inclusions, LOTS of software broke, literally over night in some cases. It was bad.

from botserver.

rodrigorodriguez avatar rodrigorodriguez commented on May 26, 2024

@chornbe, I agree with you and I lived the pain of such releases from MSFT, that's gone. We only manage General Bots project which uses Sequelize, a great database access library. @mickhansen says they are currently the same method.

I've updated all references to instance.update method. Thanks anyway.

from botserver.

chornbe avatar chornbe commented on May 26, 2024

Yeah, my commentary was about the Sequelize authors doing this repeatedly, not about anyone relying on it :)

from botserver.

chornbe avatar chornbe commented on May 26, 2024

That's good to know. My questions still remain, and I'd love to get some feedback on them if only to satisfy my own macabre need of knowing how the sausage is made. :)

from botserver.

mickhansen avatar mickhansen commented on May 26, 2024

Not sure i can provide a complete answer as Sequelize has had multiple maintainers over time.
I suppose API changes like this mostly come from a place of wanting to provide a cleaner and more sane API over time.

from botserver.

chornbe avatar chornbe commented on May 26, 2024

I guess there's always been, for me, a basic disconnect in the potential intuitive nature of it all...

There's updateAttributes({...}), there's .update(...), and there's .save(...)

Anyway, the horse is dead enough, and I don't mean to keep harping on it.

from botserver.

mickhansen avatar mickhansen commented on May 26, 2024

updateAttributes as a name made little sense, especially for new users, so over time we transitioned to really only have update and save

from botserver.

chornbe avatar chornbe commented on May 26, 2024

I got into the habit early of using updateAttributes.

For the sake of clarity, .save() only is useful when setting properties directly, such as:

obj.myName = "bob";
obj.yourName = "mickhansen";
obj.theDateToday = "2019 JUL 07";
obj.save().then(...);

... correct?

and .update({...}) is a DIRECT replacement for .updateAttributes({...}) ?

from botserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.