Connascence of Position
Connascence of Position (CoP) occurs when multiple components must be adjacent or must appear in a particular order, often when passed within a positional structure such as an array or a tuple. It is the strongest form of static connascence and must be carefully avoided, especially for higher degrees.
Let's see an example:
public class NotificationSystem { public void SendEmail(string recipient, string sender, string message) { Email email = new Email(); email.To(recipient); email.From(sender); email.Body(message); _smtpService.SendEmail(email); } } _notificationSystem.SendEmail("recipient@email.com", "sender@email.com", "text");
Here...