How would you sort these classes by dependency?

Here are the last 168 classes remaining in Spoon. I’m sorting them into a graph of dependent modules for the next release. How would you do it? Suggestions welcome.

ArrayedCollection
Collection
SequenceableCollection
Array
ByteArray
Interval
LinkedList
OrderedCollection
SharedQueue
SortedCollection

Association
Link
LookupKey
ReadOnlyVariableBinding
WeakKeyAssociation

Character
String
Symbol

Dictionary
IdentityDictionary
IdentitySet
Set
WeakArray
WeakIdentityKeyDictionary
WeakKeyDictionary
WeakRegistry
WeakSet

Behavior
Class
ClassBuilder
ClassDescription
Metaclass

Magnitude
Time

BlockContext
CompiledMethod
ContextPart
InstructionStream
Message
MethodContext
MethodDictionary

Float
Integer
LargeNegativeInteger
LargePositiveInteger
Number
Random
SmallInteger

Boolean
False
Object
True
UndefinedObject

Delay
Process
ProcessorScheduler
Semaphore

HTTPServer
HTTPAction
ExceptionMarker
OtherMarker
RemoteMethod
ClassID
MethodID
Module
ModuleDescription
Version
AuthorEdition
BehavioralEdition
Checkpoint
ClassEdition
CommentEdition
CommentedEdition
Edit
EditHistory
Edition
MetaclassEdition
MethodEdition
ProtoclassEdition
TaggedEdition
TagsEdition

Apache
GPL
GPL3
License
MIT
Squeak

BehavioralLiteralMarker
ClassLiteralMarker
ClassVariableLiteralMarker
GlobalLiteralMarker
IdentityLiteralMarker
MetaSuperSendLiteralMarker
MethodLiteralTransmissionMarker
PublishedVariableLiteralMarker
SharedVariableLiteralMarker
UndeclaredLiteralMarker

Manifest
NegativeManifest
PositiveManifest

DescribeModule
BrowseAvailableModules
EmitFavoritesIcon
InstallRemoteModule
ListInstalledModules
ModuleAction
Quit
RemoteModuleAction
RemoveModule
RunRemoteModule
Snapshot
Welcome

UUID
UUIDGenerator

CounterpartRequest
IncomingMessageExchange
MessageExchange
MessagingServer
MessagingSession
Other
OutgoingMessageExchange
RemoteMessageAnswer

Wormhole
WormholeServer

Scanner

Halt
BlockCannotReturn
Error
Exception
ExceptionAboutToReturn
Notification
ZeroDivide
ConnectionRefused
EncodingMismatch
ExternalResourceError
FailedReadingAttempt
InvalidPositioningAttempt
StreamingError
Timeout

MethodReference
Interpreter
ObjectMemory

PositionableStream
Stream
WritableStream

Correspondent
Server
SocketAddress
SocketAddressResolver
ExternalSemaphoreTable
Client
IncomingClient
IncomingHTTPClient
OutgoingClient
SocketTransport
Transport
ExternalStream
NetStream
SocketStream
TCPStream
ExternalResource
Peer
ClientTCPSocket
IncomingClientTCPSocket
OutgoingClientTCPSocket
ServerTCPSocket
Socket
TCPSocket
Advertisements

4 Responses to “How would you sort these classes by dependency?”

  1. This discussion seems apropos to what you want:
    http://forum.world.st/Topological-sort-of-classes-td3361182.html

  2. I would try the obvious first – create a set of associations X->Y by looking at each class X’s methods and checking all Ys present as a literal or as part of an association which is a literal. Then I would look at all instances of X and for each instance variable add X->Y where Y is the class of the value of that instance variable.

    Any circular references in the result, such as A->B and B->A or else A->B, B->C, C->D and D->A, indicate groups of classes that can’t really be ordered. Other than that, sort the list such that if A->B is present in the set then class A comes after class B in the list.

  3. Vlastimil Adamovsky Says:

    How do you define the dependency for each class?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: