Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I'm new in OOP. I want to learn about analyzing and problem solving through OOP.
I'll be very oblige if anyone give me a clear cut idea regarding how to analyze and solve the following system using OOP concept.
What classes, properties, and methods should be needed to solve this problem.
System is very simple-
1. There is a database containing two tables - case_memo(CM_NO, CUST_NAME, CM_DATE)and case_memo_detail(CM_NO, ITEM_NO, ITEM, QTY, PRICE) which have 1toN relationship.
2. Adding new/Deleting/Updating case memo along with its case memo details will be needed.

Thanks in anticipation.
Posted
Comments
nthaomei 12-Jul-11 5:25am    
Please anyone help me.

I'd suggest a Begginers book about OO Anylasis and Design of Software.

I could highly reccomend the following of the HeadFirst Series:

[^]

But there are also, some good Online Tutorials available
See for example here:
http://www.freetutes.com/systemanalysis/[^]
 
Share this answer
 
Comments
nthaomei 13-Jul-11 1:45am    
Thank you very much for your suggestion Legor. I'll study.
If anyone post some sample source code that is written using OOP it would be more helpful to me.
Please post any sample code..
Legor 13-Jul-11 3:01am    
You mean sample code for object oriented programming? Sure here you go:

class A
{
int b;
};

class B : public A
{

};

Hope this helps!
Seriously you cant just learn OOP from sample code! You'll have to invest a lot more time into this topic.
Thanks for your reply Logor.
For the above mentioned system i'v created two classes -
1. CaseMemo
VB
Public Class CaseMemo

#Region "Properties"
     Private _CM_NO As Integer
    Public Property CM_NO() As Integer
        Get
            Return _CM_NO
        End Get
        Set(ByVal value As Integer)
            _CM_NO = value
        End Set
    End Property

    Private _CUST_NAME As String
    Public Property CUST_NAME() As String
        Get
            Return _CUST_NAME
        End Get
        Set(ByVal value As String)
            _CUST_NAME = value
        End Set
    End Property

    Private _CM_DATE As Date
    Public Property CM_DATE() As Date
        Get
            Return _CM_DATE
        End Get
        Set(ByVal value As Date)
            _CM_DATE = value
        End Set
    End Property
#End Region

#Region "Methods"
    Public Function AddCaseMemo() As Boolean
        '' My Insert code
    End Function

    Public Function DeleteCaseMemo() As Int16
        ''My Deletion Code
    End Function

    Public Function UpdateCaseMemo() As Int16
        'my Update code
    End Function
#End Region

End Class


and
2. CaseMemoDetails
VB
Public Class CaseMemoDetails
#Region "Properties"
     Private _CM_NO As Integer
    Public Property CM_NO() As Integer
        Get
            Return _CM_NO
        End Get
        Set(ByVal value As Integer)
            _CM_NO = value
        End Set
    End Property

    Private _ITEM_NO As Integer
    Public Property ITEM_NO() As Integer
        Get
            Return _ITEM_NO
        End Get
        Set(ByVal value As Integer)
            _ITEM_NO = value
        End Set
    End Property

    Private _ITEM As String
    Public Property ITEM() As String
        Get
            Return _ITEM
        End Get
        Set(ByVal value As String)
            _ITEM = value
        End Set
    End Property

    Private _QTY As Integer
    Public Property QTY() As Integer
        Get
            Return _QTY
        End Get
        Set(ByVal value As Integer)
            _QTY = value
        End Set
    End Property

    Private _PRICE As Double
    Public Property PRICE() As Double
        Get
            Return _PRICE
        End Get
        Set(ByVal value As Double)
            _PRICE = value
        End Set
    End Property
#End Region

#Region "Methods"
    Public Function AddCaseMemoDetail() As Boolean
        '' My Insert code
    End Function

    Public Function DeleteCaseMemoDetail() As Int16
        ''My Deletion Code
    End Function

    Public Function UpdateCaseMemoDetail() As Int16
        'my Update code
    End Function
#End Region
End Class


Now I'm confused whether a property/field of CaseMemoDetails will be needed inside the CaseMemo. I'l be very grateful if you enlighten me.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900