Creating a new App: Prototyping and Re-prototyping
Last time that I wrote I told you about my new app, Kinection. One thing I noticed early in the development process was that I will do an initial prototype and little time after I will redo it again just because I’m not satisfied with it.
I had a couple of possibilities to create my app. I could have taken the native approach, Swift/IOS or Android/Java, or a cross-platform approach. I was certain I wanted to develop my app for multiple platforms. The most effective way to do this was with a cross-platform framework. I choose to develop my app in Xamarin.
Xamarin has many possibilities like Xamarin Native and Xamarin Forms. Xamarin Forms is the newest of the two were it is possible to create Android and IOS at the same time. The views would be generated by a XAML file and finally rendered by the system itself. With Xamarin Native you develop all shared code except the views so when want you can have a different layout for both Android or IOS. I choose Xamarin Cross Platform because it felt like I would have a little bit more freedom with it.
The operating system which I would start with was IOS so the I start researching the Xamarin.IOS documents. The learning curve was not that big because having some experience with Swift helped me along the way. I already knew the C# language and many of the methods used in swift were reused in Xamarin just with the method starting with a capital letter.
A good Data layer Architecture? I think not..
Poor Architecture killed me once before in a previous project and like I said before, a bad architecture will give you sleepless nights. With my previous project is was almost impossible to make some changes at the end because when I changed one part of the code I was obligated to rewrite almost every other part of my code. Learning from my mistakes was my plan, but did I?
Before writing any code , I did a lot of research. I designed class-Diagrams on paper and when I was certain having a really re-usable architecture I started developing. Wow! Such a reusable code I had never written before , I thought but I could’t be more wrong. After hours of developing my data layer I was really proud so I started developing the next layer in my app. Almost half way trough the next layer I realized that my Oh so good data layer wasn’t reusable at all! What could I do? Yes, Re prototype.
What an ugly Interface, Redo it and then redo it properly..
After I had redone my data layer I started with the view layer of the app, or the interface! There was no design yet, but I had something vague in my mind. The first design was used just for testing purposes. When testing my code was over, I restarted with a more beautiful design. Just like before I didn’t put my design on paper and after a while, the design didn’t felt wright so I redid again.
Finishing the second design let me realize that I wanted to change my view-architecture from MVC to MVVM! I used the MVC pattern just because there were a lot of similarities with IOS. The interface would be coupled to the View-Controller and in the controller a lot of execution code would be written. For Android it would be the same. All of the code in the ViewController would need be platform specific so when I would create my app for android almost everything except the data layer would need be rewritten.MVVM would make this alot more easy. So with these things in mind I started again and this time I also hired a professional designer to make the design because I just realized I was not capable of creating something beautiful for the eye.
The lesson I learned was that before you just start developing your app you need to think really good about your design! The design will also help you making your architecture decisions. And a good architecture is in my opinion the most important of all!