N
N
NoFlame2021-11-29 12:10:27
PHP
NoFlame, 2021-11-29 12:10:27

How to implement message architecture in php?

How to implement message architecture in php like in a messenger. (An example that there should be 3 folders (these are different messengers). It should be possible to send a message from one user to another.
I got the task like this and asked a question without thinking (this is me to myself). The architecture of messages within the project, which should send messages when the method is called.
The structure is as follows:
1. There should be a Messenger class "rather not a messenger, but sendmessages" "(I doubt it about the parameters, but so far I see it in my head) with the parameters setMessagerType(string $type), setSender(string $name), setReceiver(string $name) , send(string $message) this class has one task to pass specific parameters, well, messages in my case.
2. There should be a Chat class (here I also installed two main ones for myself) chatexist, savemessage, the task of this class is to save messages.
3. There must be an abstract class for all messengers, with regards to its parameters, I have so far installed one main one - getpathtochat which will not be implemented and can be sent to it in each of the classes of individual messengers.
4. Separate classes for each messenger (such as TG, Facebook
)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2021-11-29
@Stalker_RED

Everything seems to be simple:
Create three folders.
Inside the folders, create "separate files" (and what else are there?)
Then add the ability to send a message (where and how to send - you forgot to describe this, but you probably already have this idea. Do you?).
It is not very clear why this strange construction is called a messenger, but oh well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question