Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert SOLID design principles #12

Closed
mwpowellhtx opened this issue Feb 11, 2014 · 6 comments
Closed

Assert SOLID design principles #12

mwpowellhtx opened this issue Feb 11, 2014 · 6 comments

Comments

@mwpowellhtx
Copy link

TBD: I am evaluating MailKit for fitness whether it will do what I need it to do; or at least be open enough for extensibility (i.e. along SOLID design principle guidelines). TBD whether there are any issues come up along these lines.

So far what I can determine is the index-UID issue (another issue) is fairly substantial. After that I look for obvious opportunities; virtualized methods and properties, abstract classes that need to be, non-sealed classes that don't need to be, things of this nature.

Possibly more to come...

@jstedfast
Copy link
Owner

Let me know if you have any specific issues.

@mwpowellhtx
Copy link
Author

My concern here is how much of an effort it would be to break out an index-only API. I see some effort around a Command pattern also, but no Response pattern, per se, which is equally part of the protocol reading and parsing received lines from server.

Something like:

class Pop3Command
{
}

class Pop3Response
{
}

class Pop3Transaction<TCommand, TResponse>
  where TCommand : Pop3Command
  where TResponse : Pop3Response
{
}

Where command is pretty much responsible for writing through the Stream and Response is responsible for reading from the Stream. Key point being: writing and/or reading is done once, in one place, instead of repeating greeting = ReadLine, pattern I am seeing.

And so on. What I am mulling over is whether I would want to contribute along these lines.

@jstedfast
Copy link
Owner

What do you mean break out an index-only API?

@jstedfast
Copy link
Owner

FWIW, the Command/Handler pattern I'm using is simpler and more efficient than a Command/Response pattern you are talking about would be.

I still don't know what you mean by breaking out an index-only API, though. That doesn't make any sense to me because there's already an index-based API that you can use if you don't want to use the UID-based API.

@mwpowellhtx
Copy link
Author

I think I see in the GetMessageForSequenceId API. I will have a closer gander through that lens. Thank ye...

@jstedfast
Copy link
Owner

GetMessageForSequenceId is internal, you want Pop3Client.GetMessage (int index, CancellationToken token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants