Talk:Requests for comment/Service split along presentation vs data manipulation line

Strawman proposal for moving forwards
Yes please. There are numerous advantages to this, from making it easier for first time MediaWiki hackers to write patches by separating presentation from function, making code more modular and reusable and therefore increasing velocity, and increasing the ease with which functions can be exposed via the API. A task of this size is likely going to take quite some time and there will be numerous edge cases, but any progress made would be a massive step forwards. Straw man proposal for first milestone: refactor special pages so that there is no place in MediaWiki where the API has to instantiate a special page in order to function. --Dan Garry, Wikimedia Foundation (talk) 04:11, 16 February 2015 (UTC)

Architecture-level split or system-level split?
I feel the meaning of "split" a bit unclear in this proposal. Separating presentation logic from business logic is a fundamental element of every sane architecture; ensuring that no class tries to do both would be uncontroversial, I am sure. However, in the SOA discussions "split" usually means separating things into different system processes, possibly on different machines, which use language-agnostic ways of communication (such as REST). I.e., a two-tier architecture with separate MediaWiki Frontend and MediaWiki Backend applications, the frontend doing all data read/write by calls to the backend API. That's a more bold proposal with less obvious benefits, and more hardships (for one, I'm not sure it could be done with slow, gradual refactoring). So which one is being suggested? --Tgr (WMF) (talk) 05:51, 16 February 2015 (UTC)
 * I don't think it's absolutely necessary to split things such that the presentation logic and the business logic only communicate through HTTP. However, the APIs between those components should be such that a mobile application could use the same APIs over HTTP that the web application uses internally.  -- RobLa-WMF (talk) 06:39, 16 February 2015 (UTC)
 * (edit conflict) I read this request for comments as being about the splitting of business logic from presentation logic, which is something that is currently very intertwined in parts of MediaWiki. In doing that, the internal API that's used by the MediaWiki front-end would then be very clearly defined, which eases exposing it to other API consumers. I'd personally prefer that we simply focus on that task for now, because it's still a rather big task and it's a big step forwards that unlocks a lot of other possibilities. --Dan Garry, Wikimedia Foundation (talk) 06:45, 16 February 2015 (UTC)

All business logic available via remotely callable api
I would rephrase the statement "Split our backend code that deals with presentation (e.g. HTML generation, such as our skin system) from the code that deals with storage and manipulation of data." to instead say something like "All business logic must be available via remotely callable APIs". In my opinion this is the true goal of a service layer split that separates presentation logic from the business logic of the underlying system. This type of separation can be implemented in many different ways. One way is to re-arrange existing implementations in such a way that business logic is encapsulated in controller classes which communicate using well defined interfaces. These can then in turn be consumed and aggregated by other controller classes to implement view layers in HTML for consumption by web browsers and some variety of HTTP-based remote for consumption by other things. --BDavis (WMF) (talk) 06:48, 16 February 2015 (UTC)