Android HackerNews App : Refactor to Clean Architecture

A philosophy I like and have made a(n unknowingly) passive effort to implement before is called "Clean Architecture". It's the idea of an application having dependencies that flow "outward". Go read The Clean Architecture by Uncle Bob; for the full picture. A simple way to state this is, "No Circular Dependencies". If A depends on B; B and nothing B depends on can have a dependency on A. It [Read More]

HackerNews Android - Let's not crash

As discovered in our last session - Opening a lot of connections breaks things. The creation of the OkHttpClient is done in HackerNewsNetwork#getClient... ugg... A get. Ruthless refactoring! As I was saying; the creation is done in HackernewsNetwork#httpClient. private OkHttpClient httpClient() { return interceptorObj == null ? new OkHttpClient() : new OkHttpClient().newBuilder().addInterceptor(interceptorObj).build(); } Obviously just spinning up a bunch of them. We need to keep a single client to [Read More]

Interface Overloading - TDD Against UI

WTF... ... is interface overloading. Or Overriding. I kinda toggle between the terms. Right now I'm favoring Interface Overloading; so that's what the title is. Interface Overloading Interface overloading is the process I've found in C# and JAVA and Swift to allow TDD when using Libraries and OS Systems. I figure it'll work in most (if not all) languages with interfaces. Except GoLang; this is kinda how GoLang works. It's a [Read More]

Code Kata - Bowling BlackJack

As an exercise; I'm doing a CodeKata... well... working on extending a code kata via BlackJack. We've done the kata for Bowling. Now we're going to extend it to include BlackJack scoring. BlackJack is a fairly simple game to score. You have points between 1 and 11; you sum them. Right. Now make it do Bowling and BlackJack. Oh... As an added larf; Make it output FizzBuzz. Yes. I sometimes [Read More]

HackerNews Android - Get a Job

The Top Stories apparently can include job postings. I have the StoryAdapter only accepting responses that have the type of "story". We need to build up a path for Jobs because it's in the payload. Well... mostly because it crashes the app when I scroll. Network We can assume that we'll have a Job class like we have a Story class. Gonna swing in the test class to TDD it [Read More]

My Thoughts: Android App Development

I'm blogging because I'm not seeing resources that covers the things I've been asked; or that I've worked out myself (like an upcoming post about maintaining Object Encapsulation). I also blog so I can google my brain later for myself or to provide my thoughts to others in a shareable repeatable form. There's not enough examples of Software as a Craft practices, in general, with Android especially lacking. I find [Read More]

VBM on Android - Activity Testing

We're continuing our work towards understanding how we can have near 100% test coverage. I get pretty annoyed at the Activity class sitting there at super low percentages and feeling like there's nothing I should do. Not that I feel there's nothing I can do; just that "it's a boundary layer" ... A lot of the same arguments I made for the Adapter. Welllll.... That's at 100% now. I've tried a [Read More]

MyThoughts - Requirements Drive Design

A recent comment on the blog had me start to implement a Formatter for the Android HackerNews app. I did work on it and realized quickly that I had no idea what I was doing. Not that I can't code (ehhhh...); I had no requirements driving it. I was putting in a pattern for the sake of using a pattern. This emphasized to me the need to have a requirement [Read More]

VBM on Android - The Mediator

There's actually a reason I put VBM in the title of this series. And aside from some lightweight organization of the UI layer, a major aspect to the VBM structure is utilizing the mediator as the layer to encapsulate any logic branching code and protect the rest of the system from such corrupting code; as much as possible anyway. The primary goal of this post is to see how to [Read More]

Early Thoughts: Object Oriented Encapsulation

I had some training Dec 2016 on Object Oriented Programming. It was pretty mind blowing. There was a lot of frustrations during the training. Took me a few days to switch my mind around to the approach the class was emphasizing. Which is very much Object Oriented Programming. Not just coding in an object oriented language; but really structuring and designing in an Object Oriented fashion. There were a few [Read More]