Páginas

quarta-feira, 28 de setembro de 2016

Inversion of Control? Ok! Gonna try!

These past weeks a friend of mine has been sending me lots of links to videos, articles and posts about Dependency Injection and, naturally, inversion of control. It turns out that a week ago, I finished the very, very very minimal code needed to start Suna in c++:

  • A LocalHost class
  • A Channels class
  • An unreliable communication channel class
  • A wanna-be 3way handshake for starting connections on “application level”, by using UDP.


There’s enough stuff in there to start getting lost as I forget the code, but since it IS still small enough, I’ve decided to try to use a few of the concepts from inversion of control. Took a while to refactor nearly everything:
-       
  • ISocket, IEndpoint, IHost, INetworkPacket, Ietcetc. So many interfaces…
  • Constructor arguments, constructor arguments, constructor arguments….
  • Now it’s really easier to change stuff around.

      Overall, I’m liking the results even though I’m hating all the boilerplate code. It became clear that I need some kind of injector to spawn instances of my concepts, so later I’ll write some kind of abstract factory. Suna is meant to be a really small project, so probably a “poor man dependency injection” will be enough.

segunda-feira, 19 de setembro de 2016

“Posting only relevant stuff on the blog? You mad?!”

The title is the gist of it. I’ve always thought that I should only post stuff that seems relevant – to me, at least – around here. However, reading random things about devblogs, one comment made me notice one thing: it’s not about relevant contents at all. Actually, it is more about showing that we, the developers and teams, care about our projects, and are still working on them. Of course, relevant content is still better, but it’s not a rule.


That being said, it means I can post about anything that I do over the little time I have available to advance with the project. And that’s what I’ll start doing. I hope. Anyway, the c++ game engine now has a name: Nest. The game itself will be called Valsendor, probably. The network api has received the name Suna and has a mascot which I can’t draw. Naming things is hard, very hard.