C
Christine25
Guest
Hi, I'm new in OOP world, I've been using functional paradigm in vb past 5 years
and I have a task to link a vb form to a table which has got 45 fields.
It's a Form with Textbox, <g class="gr_ gr_35 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="35" id="35">comboxbox</g>, <g class="gr_ gr_37 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="37" id="37">richtextbox</g>... and all of them is a total of 45 fields.
As I learnt OOP, the book told me to always follow the below 4 steps,
and I always do so when I write a small program in OOP, but today I have many fields (45).
Below is the step I use :
1. Create 45 variables (private)
2. Create 45 properties (public - I can go for Auto-Implemented one to make it easy)
3. Create a method to store those 45 properties into the table/database
4. Create an object for the instance using "New Keyword"...
My concern is now to know if going the way I usually do is right? or maybe there's another way.
Note that I won't be able to understand <g class="gr_ gr_38 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="38" id="38">advanced</g> concept now, as I'm <g class="gr_ gr_39 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="39" id="39">newbie</g> in OOP.
I also heard about Interface (I) and I tried to understand it but still don't get it right...
as they said, when you want to create <g class="gr_ gr_47 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="47" id="47">interface</g>, they ask a question, "What do they have in common<g class="gr_ gr_51 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="51" id="51">" ?</g> but <g class="gr_ gr_48 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="48" id="48">still</g> don't get it right??
I usually use Qt/C++ and the best thing with Qt is <g class="gr_ gr_42 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="42" id="42">it's force</g> you to use OOP when you're writing code but VB doesn't.
'Variable declaration
Private variable1 as string
Private variable2 as string
Private variable3 as string
.
.
Private variable45 as string
Continue reading...
and I have a task to link a vb form to a table which has got 45 fields.
It's a Form with Textbox, <g class="gr_ gr_35 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="35" id="35">comboxbox</g>, <g class="gr_ gr_37 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="37" id="37">richtextbox</g>... and all of them is a total of 45 fields.
As I learnt OOP, the book told me to always follow the below 4 steps,
and I always do so when I write a small program in OOP, but today I have many fields (45).
Below is the step I use :
1. Create 45 variables (private)
2. Create 45 properties (public - I can go for Auto-Implemented one to make it easy)
3. Create a method to store those 45 properties into the table/database
4. Create an object for the instance using "New Keyword"...
My concern is now to know if going the way I usually do is right? or maybe there's another way.
Note that I won't be able to understand <g class="gr_ gr_38 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="38" id="38">advanced</g> concept now, as I'm <g class="gr_ gr_39 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="39" id="39">newbie</g> in OOP.
I also heard about Interface (I) and I tried to understand it but still don't get it right...
as they said, when you want to create <g class="gr_ gr_47 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins doubleReplace replaceWithoutSep" data-gr-id="47" id="47">interface</g>, they ask a question, "What do they have in common<g class="gr_ gr_51 gr-alert gr_gramm gr_inline_cards gr_run_anim Style multiReplace" data-gr-id="51" id="51">" ?</g> but <g class="gr_ gr_48 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="48" id="48">still</g> don't get it right??
I usually use Qt/C++ and the best thing with Qt is <g class="gr_ gr_42 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="42" id="42">it's force</g> you to use OOP when you're writing code but VB doesn't.
'Variable declaration
Private variable1 as string
Private variable2 as string
Private variable3 as string
.
.
Private variable45 as string
Continue reading...