[Gambas-devel] [RFC] Gambas implementation of the pop3 protocol

Sebastian Kulesz sebikul at ...176...
Mon Aug 27 00:24:24 CEST 2012


On Sun, Aug 26, 2012 at 6:36 PM, Fabien Bodard <gambas.fr at ...176...> wrote:
> 2012/8/26 Fabien Bodard <gambas.fr at ...176...>:
>> why
>> stripOK
>> IsPositive
>> IsNegative are STATIC PUBLIC and not simply PRIVATE ?
>
> stat must be private too... i think
>
> YOu must to hide the functions retrieve too has you use _get for that
> and the function in the children class.
>
> so pop3 must just have
>
> IN PUBLIC
> connect
> disconnect
> delete
> reset
> count
> close
> size    is the size of all messages
> _get
>
> The message classe :
>
> Top(lines as integer)
> Text
> UniqID
> Size
>
>
>
> so please re read Benoit 's mail about interface ...
>
> - The number of messages to read. (STAT)
> - The size of all theses messages. (STAT)
> - The size of one message. (LIST x)
> - One specific message. (RETR x)
> - Delete one message. (DELE x)
> - Undelete all messages. (RSET)
> - The beginning of a message. (TOP x n)
>
> All that could be done with well-named method, the _get special method...
>
> - The number of messages to read. -> .Count
> - The size of all theses messages. -> .Size
> - The size of one message. -> [x].Size
> - One specific message. -> [x].Text
> - Delete one message. -> [x].Delete()
> - Undelete all messages. -> .Reset()
> - The beginning of a message. -> [x].Summary ? OR .ShortText
>
> if you want you can use that trick too
>
> in__get
>
> dim hPopMessage as New _PopMessage as "Message"
>
> return  hPopMessage
>
> end
>
>
>
> in the popmessage class you can the se the current instance of
> pop3Client as you need to be able to manage multiple instance
>
> for example in the text proc
>
> Private Function Text_Read() As String
>
>   dim hPopClient as pop3client = Object.Parent(me)
>   Return hpopClient._Retrieve($msgid)
>
> End
>
>
> you need to use only local declaration for that to not have freeing
> problem then.
>
> so this line :
> dim hPopClient as pop3client = Object.Parent(me)
>
> need to be in all the sub of _popmessage to get the instance that own
> the message child.
>
> i don't know if all of that can help you ...
>
>
>
>
> --
> Fabien Bodard
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-devel mailing list
> Gambas-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-devel

I'll go step by step. Firstly you are right, i don't like Variant[] as
a signature either, so UniqueID() and List() both return a String[]
now.

StripOK, IsPositive, IsNegative are static because they don't depend
on the object instance. No need to make them private. What if the
developer wants to parse the response on his own?

It's ridiculous to make Stat private. Why should we hide a pop command
from the developer? I also prefer to let the developer choose how to
access the POP commands, either by methods or by using the _get
_POPMessage instance (we may also implement some type of caching
here). This may change too

There is a method already to get the beginning of a message, see Top()
and  _POPMessage.Top()

The last part seems to be really confusing, can you explain better please?

Thanks for your feedback!




More information about the Devel mailing list