Solarex's Blog

我只想过,平平淡淡的生活,欲望啊,请放过脆弱的我

The Basics of AOP

| Comments

Aspect Oriented Programming

AOP is both a complex and quite simple thing. There has been a lot of buzz around AOP but recently the buzz has faded. The question that people still ask is “what do I do with it”. Hopefully you will have an idea of what it is and create your own thoughts on how you could use it.

In this post I aim to describe what AOP actually is and how it works.

AspectJ - Dictionary

| Comments

What is AOP

Every time someone tries to explain AOP (Aspect Oriented Programming) they often use words like “magic” or “black magic”. And that’s understandable, especially if you come from an OOP world and come across AOP it really feels like “magic”: something is happening and you as a developer usually don’t know why, what or how.

AspectJ is one of the more well-known implementations for AOP in Java and is developed by the Eclipse Foundation. In this series of articles we will be concentrating on AspectJ’s implementation of AOP and how it works in Java.So, let’s dive into AspectJ and make an effort of dispersing the mystic around the so-called “black magic”. Let’s start by building a dictionary with short explanations of some key terms.

Make an Android Custom view,Publish and Open Source

| Comments

Today I’m going to create an android custom view to implement circular SeekBar like the mockup below, make it as a library, open source at GitHub, and publish it to JCenter. In this post, I will cover several fundamental concepts of android custom view, write a helpful README on GitHub, and how to publish your library.

Before you start…

Try to understand the requirement or design specification, take a look at this widget first, the user can touch the indicator icon through this arc to set the current progress level. The indicator icon will stop dragging when exceeding max or min progress. It works like an extension of circular SeekBar with customized appearances and motion event.

Mobile Apps Offline Support

| Comments

Offline support for mobile applications can be thought of as the ability for the application to react gracefully to the lack of stability of the network connection. The rather new context of mobile devices introduced problems such as presence or absence of a network connection or even high latency and low bandwidth. These problems are rather new and thus not very well known to engineers starting with mobile development. Among other things building a mobile application which resilient to different network scenarios could mean:

  • Displaying comprehensive error messages when network calls fail.
  • Allowing the use of the application in “guest mode”, where certain features can be delayed until the user actually signs in.
  • Visually displaying the absence of network connectivity on the UI (connected mode/offline mode).
  • Disabling controls in the absence of network connectivity.
  • Allowing the user to query and act on data while no network connection (offline data access).
  • Testing the application under different network conditions!

While all these things are extremely important from the usability point of view, there is one of these that can be particular complex, “offline data access”. There are several different scenarios or levels of offline data access that applications might need to support, and I’ll go through each next.

The Clean Architecture

| Comments

Over the last several years we’ve seen a whole range of ideas regarding the architecture of systems. These include: