samedi 11 avril 2020

Ionic app component design approach suggestion

I am new to Ionic 5 and learning it by doing a sample app. I am working on a app called Card Holder which is a solution to save the card information in to the phone. For example I have a physical debit card end user with help of my app can save information like Debit card no, Expiry, Name, cvv and capture front and back card images and data gets stored inside phone and whenever user wants it he can see the saved details from the App. In the same way the app should support types of cards like Aadhar card, PAN, Driving License, ID Card, Voter card etc.

Challenges in this App
1. Multiple categories of card needs to be supported
2. Each card may have different form fields. For ex debit card have four text fields(no,expiry,cvv,name) where as pan and aadhar card will have only one form field (Number only)

So I want to efficiently design my Angular code. I have 2 solutions in my mind

Solution 1
Have individual components for each card type i.e debitcard component, aadhar card component, pan card component etc based on the card type component will be rendered.

Solution 2
Create only 1 component will multiple in it each corresponds to each card type. Remaining divs will be hidden based on card type choosen

But I don't think those are efficient approaches. Please help me in designing this app efficiently

Aucun commentaire:

Enregistrer un commentaire