robotoworks / mechanoid

Eclipse plugin providing a set of DSL's for the rapid development of Android apps
58 stars 26 forks source link

reduce notifications #262

Closed hannesa2 closed 1 year ago

hannesa2 commented 9 years ago

First, does a save() without anything changed will perform a notification to Contentprovider ?

If yes: I see in ActiveRecord

public long update(boolean notifyChange) {
        AbstractValuesBuilder builder = createBuilder();
        builder.update(mId, notifyChange);
        makeDirty(false);
        return mId;
}

so every time a save() is fired, a notification is performed independent if a notification is required. What do you think about a logic which only fires if it is necessary like:

public long update(boolean notifyChange) {
        AbstractValuesBuilder builder = createBuilder();
        if (notifyChange && isDirty()) {
            builder.update(mId, notifyChange);
            makeDirty(false);
        }
        return mId;
}

mechanoid should generate isDirty() This will help us to reduce unneeded notification and it's string of events

fluxtah commented 9 years ago

Yes I think that logic makes sense to put in as it should not update if its not dirty