Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Editing Newsreader/enhancing salvo newsreader/Porting Existing NNTP Implementation

Abstract

Porting the existing implementation to newly invented features was a challenge. There were lot to change and many aspects to think of. Always the UI should be generic and protocol dependent implementations should not reside in UI classes. Clear separation between back-end and front-end is always expected.

Work Done

In the earlier Salvo implementation Server(changed as NNTPServer in our context) is created at the UI level as soon as user enters the user information. But initializing a protocol dependant server cannot be done at UI level since we have to always check for protocol type before creating Server. So it will result in lot of if elses. Solution was to implement a generic Server. This server implementation just serve the purpose of information passing. It is a very lower level implementation with fewer methods since it is generic. This server will be converted to a protocol dependent concrete form once the container of particular protocol type is initialized. setServer(IServer server) method of container can be used to extract the details from generic container and then initialize protocol dependent server(Ex:NNTPServer)

Initial container creation is done inside NewNewsServerWizards's getNextPage() method. Earlier it was inside performFinish(). Reason to this design decision is in the next page of NewNewsServerWizard the newsgroups/forums of the given address should be shown in a list to get selected  user. So at that point concrete implementaion should initialize. After creating the container it is shared using the mechanism described in [1] so that other UI elements can get use of same container.

When using common functionality provided by adaptor ITransactionContext are created and additional information is shared through them. This approach removes the need of changing the connectivity API's method signatures due to parameters.

Another decision came while refactoring is to use IMessageSourceProvider(Earlier known as INewsgroupProvider) as a generic element and always get message sources through message providers. So each protocol dependent implementation should implement IMessageSourceProvider.


[1] http://wiki.eclipse.org/Newsreader/enhancing_salvo_newsreader/Container_Implementation#Container_Sharing

<<Under Construction>>

Back to the top