Skip to content

Conversation

alexvaluyskiy
Copy link
Contributor

@alexvaluyskiy alexvaluyskiy commented Mar 18, 2017

  • Made most of the public classes as sealed
  • Replaced public fields by properties
  • Changed visibility of serialization members

@@ -62,44 +62,44 @@ public static ClusterClientSettings Create(Config config)
/// <summary>
/// Actor paths of the <see cref="ClusterReceptionist"/> actors on the servers (cluster nodes) that the client will try to contact initially.
/// </summary>
public readonly IImmutableSet<ActorPath> InitialContacts;
public IImmutableSet<ActorPath> InitialContacts { get; }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expose ImmutableList instead of some ReadOnly abstraction?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing the interface is fine imo.

}
}

/// <summary>
/// TBD
/// </summary>
[Serializable]
public sealed class GetTopics : IEquatable<GetTopics>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need an IEquatable for singletons?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Seems unnecessary

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is serializable class. Singleton messages are not guaranteed to be deserialized back into Instance object. Moreover, usually they are guaranteed to be different objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't transfer this object via wire. it is local only

public CurrentTopics(string[] topics) { }
public string[] Topics { get; }
Copy link
Contributor Author

@alexvaluyskiy alexvaluyskiy Mar 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not fan of exposing arrays in public APIs. Could I change it to IReadOnlyCollection ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I do not think it matters much. Wrapping it in an IReadOnlyCollection in this case only provides an illusion of safety.

@Danthar
Copy link
Member

Danthar commented Mar 20, 2017

Another note that I want to add. Im not a fan of forcing people to define an IImmutableSet for their initial contact list.
I think its an implementation detail that should be the responsibility of the underlying structure. And not the user.
Same goes for the WithInitialContacts function.

We could still provide a private copy constructor that does accept the ImmutableSet parameter though.

@Aaronontheweb
Copy link
Member

@alexvaluyskiy minor merge conflict

@Aaronontheweb
Copy link
Member

@Danthar @alexvaluyskiy @Horusiath is this ready for merge?

@alexvaluyskiy
Copy link
Contributor Author

@Aaronontheweb ready

@Aaronontheweb Aaronontheweb merged commit a770bee into akkadotnet:dev Mar 27, 2017
@alexvaluyskiy alexvaluyskiy deleted the singletonstable branch April 2, 2017 09:46
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

Successfully merging this pull request may close these issues.

4 participants