Merge lp:~robert-ancell/mir/frontend-class-renaming into lp:~mir-team/mir/trunk
Status: | Rejected |
---|---|
Rejected by: | Robert Ancell |
Proposed branch: | lp:~robert-ancell/mir/frontend-class-renaming |
Merge into: | lp:~mir-team/mir/trunk |
Diff against target: |
486 lines (+73/-117) 11 files modified
src/server/frontend/CMakeLists.txt (+3/-4) src/server/frontend/make_socket_communicator.cpp (+2/-2) src/server/frontend/message_processor.cpp (+31/-31) src/server/frontend/message_processor.h (+8/-8) src/server/frontend/message_sender.h (+9/-25) src/server/frontend/null_message_processor.cpp (+0/-26) src/server/frontend/socket_communicator.cpp (+10/-10) src/server/frontend/socket_communicator.h (+6/-6) src/server/frontend/socket_session.cpp (+1/-1) src/server/frontend/socket_session.h (+1/-2) tests/mir_test_doubles/test_protobuf_socket_server.cpp (+2/-2) |
To merge this branch: | bzr merge lp:~robert-ancell/mir/frontend-class-renaming |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alexandros Frantzis (community) | Needs Fixing | ||
Alan Griffiths | Needs Fixing | ||
Daniel van Vugt | Approve | ||
Kevin DuBois (community) | Needs Information | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+156430@code.launchpad.net |
Commit message
Refactor frontend code to use simpler and more consistent class naming
Description of the change
Rename some of the classes in the frontend to make it simpler to understand. This is based on my first impression of understanding the frontend code. While I could see the intention to make the transport layer (socket, binder) and protocol (protocol buffers) flexible I found this to confuse the classes and be overly abstracted.
1. Rename ProtobufSocketC
This is because the Protobuf part is confusing
- It makes the relationship to SocketSession less clear.
- The Protobuf prefix is not consistently applied, i.e. SessionMediator is also Protobuf dependent but doesn't use the prefix.
- One prefix (Socket) is simpler than two (ProtobufSocket).
2. Rename ProtobufMessage
This is the last remaining "Protobuf" class so removing it seems ideal.
- Removed the NullMessageProc
- message_process.h was overloaded with two classes (MessageProcessor and MessageSender) - Move MessageSender to its own header file and just use protobuf_
The one part that doesn't feel great now is the fact that there is a clear abstraction for MessageSender, but not for MessageProcessor (which is tied to protocol buffers). I didn't have a good name for using MessageProcessor as the interface and ?MessageProcessor as the implementation. We could use SocketMessagePr
The use of "Processor" as a name seems a bit vague to me (i.e. most classes are "processing" something). I think it would be better to use names that are clearer inverses e.g. Sender/Receiver, Encoder/Decoder or Serializer/
(The last two points are worth discussing but I don't think need to be solved by this merge).
PASSED: Continuous integration, rev:550 jenkins. qa.ubuntu. com/job/ mir-ci/ 271/ jenkins. qa.ubuntu. com/job/ mir-android- raring- i386-build/ 220 jenkins. qa.ubuntu. com/job/ mir-clang- raring- amd64-build/ 103 jenkins. qa.ubuntu. com/job/ mir-quantal- amd64-ci/ 272 jenkins. qa.ubuntu. com/job/ mir-quantal- amd64-ci/ 272/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ mir-vm- ci-build/ ./distribution= precise, flavor= amd64/80
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ mir-ci/ 271/rebuild
http://