Giter VIP home page Giter VIP logo

Comments (5)

dannygreg avatar dannygreg commented on May 16, 2024

I like that idea quite a bit.

I would suggest hacking and sending a pull request, code is always better than a suggestion 😄

from mantle.

amyworrall avatar amyworrall commented on May 16, 2024

I'm playing with this and a few other additions in a project I'm working on. I'll see how well they stand up to use, and if they work OK I'll look into contributing.

from mantle.

dannygreg avatar dannygreg commented on May 16, 2024

Exactly the reason a pull request is always preferred. :neckbeard:

I'm going to close this in the anticipation of a future pull request. Would love to see what you come up with!

from mantle.

foo4u avatar foo4u commented on May 16, 2024

I know this just got closed, but if a pull request is going to be created, I suggest the method be made inverse. Perhaps MTLModel can provide (NSSet *)propertyKeysForEquality that subclasses can override to remove elements that aren't desired for equality testing.

from mantle.

jspahrsummers avatar jspahrsummers commented on May 16, 2024

I think this should be handled with an application-level override of -isEqual:, since we could go on forever about all the different ways that people would like to override MTLModel's default behaviors. Subclassing and overriding works quite well, and generally reduces the complexity of the MTLModel interface.

Suppose I have some properties that hold cached data — stuff that can be derived but at a time penalty, so I'm cacheing it in the model. I'd like to exclude such properties from equality calculations.

In this particular case, it sounds like you would want to exclude those properties from most things, including copying and archiving. That can be done with a +propertyKeys override.

from mantle.

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.