|
-
Nov 6th, 2003, 11:37 AM
#1
Thread Starter
Hyperactive Member
Question about a class
New to OOPS and VB.NET
I am trying to design a class called 'RATE'
The rate object can be a "simple rate" or "Complex rate". The attributes of both simple rate and complex rate are exactly same. Its just that the complex rate is summation of 2 or more simple rate objects.
Design question:
1. since both the simple rate and complex rate have same charecteristics. I probably should design only once class called as 'RATE' class which has the interfaces and implementation.
Is that correct way of thinking?
2. The calling object/function should be intelligent enough to decide when it needs a simple rate or complex rate. And if it need an simple rate object it will instantiate only object of the 'Rate' class and if it decides that it needs a complex rate then 2 or 3 instances of 'RATE' class should be instantiated.
Is that correct way of thinking?
OR should I create an abstract 'RATE' class and create 2 derived classess called 'Simple Rate' and 'Complex rate"
-
Nov 7th, 2003, 05:01 AM
#2
Addicted Member
OR should I create an abstract 'RATE' class and create 2 derived classess called 'Simple Rate' and 'Complex rate"
I would probably choose this option - even though it might seem like overkill for such a simple class it does fit in better with the OO model
-
Nov 7th, 2003, 11:36 AM
#3
Thread Starter
Hyperactive Member
THANKS for the reply..
while I am learning how to implement OOPS concepts (abstraction, inheritance, overloading ...ect) in vb.net , I am reading UML books.
Where does the concepts UML fit in OOP? Like say "Composition" relationship between classess. According to the definition of composition if there is parent-child relationship. Container class and contained class.
say for example "Bank" is a class and "Bank Account" is another class. with out "Bank" class there can't be a "Bank Account" class and there can be many "Bank account" classess for each "Bank class". Is there a specific way we can implement the various relationships of classess in VB.NET? where does the INHERITANCE fit into all the UML concepts? Pls help me out here ..thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|