I'm trying to write an application following the MVC architecture, more specifically the follwing approach: ![following approach](https://lkubaski.files.wordpress.com/2012/12/mvc1.gif)

The controller:

```
public class Controller{
    ...

    public void newName() {
        model.setName(name);
    }

    public void newFoo() {
        model.setFoo(foo);
    }

    public void newBar() {
        model.setBar(bar);
    }
}

```

The model:

```
public class Model{
    ...

    public void setName(String name) {
        this.name = name;
        update();
    }

    public void setFoo(String foo) {
        this.foo = foo;
        update();

    }    
    public void setBar(String bar) {
        this.bar = bar;
        update();
    }

    // Update implemented like this:
    private void update() {
        setChanged();
        // calls update(...) on observers
        notifyObservers();
    }
}

```

The view:

```
public class View{
    ...

    public void update(Observable o, Object arg) {
        Model model = (Model) o;
        fieldName.setText(model.getName());
        fieldFoo.setText(model.getFoo());
        fieldBar.setText(model.getBar());
    }
}

```

My problem is that if I don't want to update the entire view at the same time, as in updating both name, foo and bar, in the view, I'll have to do type checking or create an if-else chain, to test which field was updated.

If I'd used listeners, I could implement a concrete method call for every field.

However, I feel that both these approaches break with good OOP and modifiability/loose coupling, and so on. What happens if I have 100 fields in the model? 100 Separate if's/methods?

So I suppose what I'm asking is, what is the best, in regard to OOP and modifiability, way to update only the required field in `update()`, without having to update everything?

Could I solve this with polymorphism?

*I excuse asking such a possibly broad question, but I've been struggling with this for a while, and I did not find any other threads that I felt could give me a good answer, so I thought I'd try making my own thread. I might not have found similar threads because I don't really know what to search for.*