Bringing order in files

One of the main paradigm we followed during Fitradar application development was Object Oriented Programming paradigm. And the main objectives of OOP are:

  • to organize the code in such a way that data and functions using its data stick together in one entity (class),
  • to extract reusable parts in separate entities (classes interfaces).

And as we followed the OOP principles and patterns our big code evolved in to many small files, each representing one or sometimes several entities. Each file contained clean and well organized code that was easy to maintain. From one hand we reduced the size of the files and such improved the navigation within a file but increased the number of files. And the more files we produced the more harder it became to navigate between the files. And very quickly it became clear that we need a new way how to organize our code-base files that anyone could quickly find a needed file. And since there are several ways how to organize the files in packages and the source code packaging really depends on the project, in this article I wanted to share our teams experience on how we found a way that helped us to find file quicker in our code base.

The goal of organizing files in packages is to allow a developer or any other person who is working with a source code easily find a needed data type. In order to achieve this we had to introduce particular principles on how to organize files within a packages. And once a person learns these principles it should be a breeze for him to find a necessary type. When we thought about it, we came to conclusion that these principles should act like search algorithm but for human. The basic partition of our source code in separate projects was predefined by Clean Architecture. It gave us a basic understanding where to put files on the high level. In our first attempt we tried to put the same type data under the same package. For example all the repositories definitions we kept in package com.fitradarlab.fitradar.domain.repository, all the retrofit endpoint definitions we kept in package com.fitradarlab.fitradar.data.net.endpoints and so on. This kind of approach introduced by Clean Architecture worked well in data and domain projects, but when we tied to apply it to the UI project it didn’t really helped us. And the reason was the way how we worked with UI part of the project. Our work was organized around the use cases. And to implement a use case on the UI level we had to work simultaneously on Activity, Fragment, ViewModel, Dagger dependency Module, layout and navigation. All these types were located in different packages and under each package there were already quite a few other files and therefore it was hard to find a needed file fast. First to mitigate the problem we tried to keep all the files of a use case opened, but we realized quickly that the more files we open in Android Studio the less we see of a file name in a tab because it shrinks. So even on our big screens we could have only 5-7 files opened, but in many cases we needed more than that. It was not right away that we noticed that the files we try to keep opened belong to one use case, but once we realized that it became clear that we need to put those files under the same package. Once this discovery was made the new packaging structure for UI project was born. We completely refactored UI project by introducing packages that reassemble the names of our use cases. And thanks to Android Studio refactoring tools it took only a few hours, and after that we really felt comfortable with the new packaging structure. Now we didn’t have to keep the bunch of file opened because all the files we needed to work with were visible under the single package in Project window.

New UI project package structure

But there was still one problem left – the resources files. Contrary to source code where developer can create a hierarchy of packages the resources have only several predefined folders and the most used resource types like layouts and drawables usually have long list of files. And once again we applied the use case approach and came up with following naming convention for our layout files: the layout file starts with the type – fragment, activity, row or view, then we mimic the name of the package and the name ends with unique name of the layout. For example the layout for our timeline page has the name fragment_sport_event_timeline.xml. Unfortunately we still can’t find a good naming strategy for drawables and other shared resources that are not bind to particular use case, but already now with these new naming conventions we see a noticeable improvement in our source code maintenance.

Visit our website and join the mailing list. Our app is coming soon:

http://fitradar.me/

10 Things Your Personal Trainer Won’t Tell You

Sometimes it can feel nearly impossible to get yourself in shape, which is why personal trainers are so helpful. Not only do they give you that extra push, but you also get the benefits of their expert knowledge and experience. Even with their guidance, however, your efforts will be in vain if you aren’t following the right diet and fitness regimen for you. To find out exactly how you can improve your fitness routine, WD spoke with top-notch personal trainers for their secrets to getting the most out of your workout and living an overall healthier life.

1. Set realistic goals and be confident.
Before starting your path to a healthier lifestyle, it’s important to be realistic about how much time you have for the results you want, and how you can achieve them. Colleen Faltus, private trainer at The Sports Club/LA in Boston, suggests compiling “a list of both short- and long-term goals. This will keep you motivated to accomplish and surpass them; it will give you focus and add some variety to your workout.” Another trick to staying focused? Be confident! Trainer Bill Trimble, founder of the workout program Extreme Bill Trimble, says, “if you’re not confident and determined you can achieve your goals, you won’t. Make sure you try to stay positive and keep your head up, even on those rough days.”

2. Get specific about what you want to achieve.
Although you may think your trainer will automatically know what you want, that isn’t the case. Trimble says telling your trainer exactly what your goals are is the key to success. A weight-loss plan, for instance, will be different from a plan for someone trying to build muscle. Your trainer will design a routine based on your individual needs and lifestyle, so letting him or her know exactly what you want up front will help you get the most out of the experience.

3. Have fun!
“Working out should be enjoyable. Your personal trainer is there to push you a little bit, but not intimidate,” says Trimble. During your initial consultation, talk with your trainer about activities you enjoy, your schedule and exercises you don’t particularly like. This way, he or she can devise a routine you’ll love. Another key factor to having fun is variation. “Incorporating other elements of fitness besides cardio will increase the likelihood of faster and more efficient weight loss,” explains Faltus. Another plus? You’re less likely to become bored if you try new things.

4. Performing each exercise correctly is imperative, so watch your form.
To achieve the best possible results and stay injury-free, follow your trainer’s instructions about proper form. This is especially important if you’re doing an at-home workout on your own. “Model the video or demonstration exactly, paying special attention to the trainer’s breathing technique and form,” Trimble urges.

5. You should begin to see results within 12 weeks.
Depending on your workout plan, the three-month mark can be a good indicator of how you’re doing. “In about 90 days, you should be able to notice results—whether it be that your jeans are a little looser, your quality of sleep is better or you just feel good all around,” Trimble says. Many people lose motivation if they don’t see results sooner, but you’re changing your physique, so 12 weeks is about how long it will take before your workouts begin building lean muscle.

6. Communication is the key to success.
As with any relationship, communication is vital when it comes to a healthy and happy experience. Faltus recommends giving your trainer feedback about how you are or aren’t liking the exercises, what is or isn’t working and anything else that’s on your mind. Most often, your trainer will check in with you before and after the workout. So use the opportunity to talk! “You know your body better than anyone else, so speak up at each session and your experience will be that much more enjoyable and exciting,” Faltus says.

7. You’re going to have bad days.
“You’re going to fall off the wagon and have off days at some point,” says Trimble. “But get right back up and begin again without getting discouraged.” The biggest problem trainers see in their clients is that their emotional confidence starts to dwindle when something goes wrong. “You have to believe in yourself and [believe] you can do it,” Trimble says. So, if you splurge on your eating one weekend, don’t beat yourself up—just give it your all during your Monday workout session.

8. If you don’t have a trainer, you can still stay motivated.
On those mornings when you just can’t get yourself out of bed, it’d be pretty nice to have a trainer waiting for you at the gym. But you don’t need a trainer if you know how to find motivation elsewhere. For one thing, Trimble recommends working out with a partner for extra encouragement. He also suggests choosing a fun workout so you’ll look forward to it. “These days, so many programs are easily accessible, such as at-home boot camp workouts, circuit training, online videos and specific plans such as the P90X workout.” And perhaps most important, be consistent. If you exercise on the same days every week, not only can you schedule around your workout, but you’ll be more likely not to miss it.

9. You have to eat right, too.
Personal trainers aren’t miracle workers, so after you leave the gym, make sure you follow the diet plan you’ve established for yourself (or with the help of a dietician). One way Trimble helps his clients eat right is by encouraging them to keep a food journal. “Nutrition can be a problem, so writing it down and being able to look at it with my clients is helpful,” he says. Not only will you be able to discuss what you’re eating with your trainer, but you’ll also become more aware of your food choices—and rethink that second piece of cake! One way Faltus suggests you start a good nutrition plan? Let yourself cheat. “Eating balanced meals filled with fruits, vegetables, grains and protein will prove successful in the long run. But remember to give yourself a ‘cheat’ nutrition day on the weekends.”

10. You’re probably not getting enough sleep.
“Lack of sleep causes a decrease in energy and motivation to accomplish both short- and long-term goals.” Not only are proper sleeping habits important for you mentally, but if you don’t rest your muscles properly before and after a good workout, you risk injury. Faltus says to “adjust your sleep schedule and get both quality sleep and a decent quantity of sleep. You’ll notice the difference in your overall performance, and your muscles will thank you too.” For some tips on how you can destress and unwind before bed to sleep better, click here.

Source: https://bit.ly/35QuewC

Please visit our website and join the waiting list. Our app is coming soon: http://fitradar.me/

5 things a good personal trainer would never do

In every field, there will be a few different ways of doing things. Although other careers will have people doing things differently, all with the end result being positive, there are some things a personal trainer really shouldn’t ever do. When it comes to being a Personal Trainer, some things are non-negotiable as they can lead to injuries, bad experiences for clients and eventually, the loss of a client base for your business. Australian Institute of Fitness Victoria Fitness Coach, Christopher Meggyesy, lays down the 5 things a great Personal Trainer would never be caught doing.

1. LOSE FOCUS

A great personal trainer’s client focus doesn’t ever waiver. There are some Personal Trainers out there that remind me of Dory from Finding Nemo; very easily distracted. Your clients are paying for YOUR time. From the moment you greet your 10:30 client to the moment they leave, the great PT is 100% about their training. Whether it’s fixing technique, handing their client a water bottle, or just being the motivation they need, it’s all about your client. Whoever it is that just walked in the gym, they can wait. If you’re a personal trainer and you are constantly getting tied up with other things, checking your phone or chatting with other people during a client’s session, you may find some clients parting ways with you and finding someone new.

2. DOESN’T PROGRAM

The great PT will have every moment of the training session accounted for prior to beginning the session. It’s pretty obvious when the PT is umming and ahing about what’s next for the client, they’re winging it. A PT should know what is happening at each minute, what will be covered and how to get the best workout completed specific to the client within the time they have booked with them. If a PT seems to be lost, chances are they aren’t really sure of what the client needs in order for them to reach their goals. Remember, those who fail to plan, plan to fail.

3. TRAIN EVERY CLIENT THE SAME WAY

Every client is different, aren’t they? They have each got their own little quirks, health concerns, and movement deficiencies. So why are there so many cookie cutter programs out there? Each program should be tailored to the client’s needs, that’s part of what your client is paying you for. One of the first things a personal trainer should be doing within the first session is asking what a client’s needs and wants are, what their goals are, what they hope to achieve and also ask about the client’s past history with exercise. A PT should understand completely what a client is capable of doing (and not doing) and working on the areas they wish to work on in order to achieve their goals. Because everyone has different goals, everyone’s session should look and feel different.

4. LOOKS AT THEIR PHONE

iPhones, Android phones, Windows phones, even your old Nokia! No matter what the brand, having one in your hand while you’re taking a session, regardless of the intention, just looks like a distraction. You may very well be timing your client with your stopwatch app, but to the outside world and any future clients that may see your session, they can’t tell the difference between timing a client, and swiping right on Tinder. Clients are paying for the time and attention of a trainer for a reason. The best PT’s should ditch their phone for the whole session and their focus directly on the client at all times.

5. DOESN’T WALK THE TALK

Let’s face it, you are your own brand. Prospective clients start forming opinions about you the second they see you. In that first second, how are you marketing yourself? That first second might come when you turn up for your 5:30am client on a Monday morning, and a brand new member to the gym sees you as you walk in the door. Do you look (and smell) like you just rolled out of bed, or do you look clean, neat and tidy with an awesome smile? Ask yourself, who are you more likely to hand over your hard money earned to? Someone who looks and acts like a professional, or the slob that just rolled out of bed? Feeling and looking fit and healthy is going to also rub off on the client’s. A client is going to feel more motivated to get up early and get a great workout completed if their PT looks like they’ve already completed it and are now feeling (and looking) fantastic.

A trainer should be there to help, motivate, assist when needed and provide the right training and fitness advice possible for each and every client. Getting to know a client is a must-have and being able to provide the right workout for each client is a necessity. If you’re a PT and you find yourself doing some of the above things, it may be time to step back and take a look at your role and look at ways you can address them and help your clients to reach their full potential once more. If you’re a client and are noticing some of these “red flags” with your own trainer, it may be time to take a look at other trainers in the area who may be able to help you succeed. 

Source: https://bit.ly/2ou8xkK

Visit our website and join the mailing list! Our app is coming soon:

http://fitradar.me/