Hardtack / RxMVC-Java

Experimental MVC with ReactiveX
4 stars 0 forks source link

it looks like MVP. #3

Open SeongUgJung opened 8 years ago

SeongUgJung commented 8 years ago

I looked your sample code GithubSearchActivity & UpDownActivity.

but It seems not to be MVC but MVP.

this is the reason :

View has trigger Event to Controller Controller cannot know View' State. Controller send callback to View (even though implementation of Rx, but It can change callback)

Implementing MVP is so many types.

  1. Directly View-Presenter.
  2. Under Umbrella.
  3. Supervisor MVP. ...etc

Type 1 is V-P know each other. Type 2 is V-P don't know each other. but V-P are in Mediator for Operator. Mediatoer know V & P. for V -> P, View request to Mediator. Presenter also do it. this link is about Type 2 posting.

I think In your code, kr.geonu.mvc.MVC is a kind of Mediator for Operator.

SeongUgJung commented 8 years ago

It's not a blame. I think It can be to improve to MVW (Whatever). actually since before 6month, I thought how to be MVW on Android, using Rx.

so I will keep watching this repository.

Hardtack commented 8 years ago

I still think that it is MVC, But it also can be MVP as well.

I don't know what the precise definition of MVC is. Because there are so many variations of MVC, and some of variations are renamed to MVP, MVVM, ... What I'm interested in is wikipedia's definition. It says model-view-controller as following. 500px-mvc-process svg By the this definition, I thought view is a function that gets a model as input, and returns event as output, and controller is a function that gets a event as input, and returns model as output. Based on this idea, Controller cannot know view's state, and it is still MVC.

Since MVP is a kind of variations of MVC, the difference between MVC and MVP is ambiguous. But, most important idea of this project is, force data flow to be unidirectional like flux. (Actually, I think that flux is also a kind of variations of MVC)

SeongUgJung commented 8 years ago

you say Actually, I think that flux is also a kind of variations of MVC but flux or redux was called MVW.

you still insist that this code is MVC model. actually it looks MVP.

because in your code, user send to View and View trigger to Controller that flow is MVP's

where event was started is so important and show different between MVC and MVP.

in MVC, it was started event from Controller. but not your code. that is why I told your code is MVP

Hardtack commented 8 years ago

Could you give me a reference or example of MVC that starts event from Controller? I think, I'm in lack of precise (or original, not varied) definition of MVC.

SeongUgJung commented 8 years ago

this article explained what different is between MVC, MVVM, MVP.

mvc-mvvm-mvp

and this github page is about MVP for Android Application. https://github.com/googlesamples/android-architecture

Spring Web Framework is well-formed on MVC (SpringMVC) in Spring Framework, it said @Controller or @RestController was got event from RestAPI.

we need clarify what are MVC, MVP.

if you come to gdgkr slack, then we could discuss more about this. (this slack is for only korean. if you are not, sorry. we should keep on in this page.)