Link to home
Start Free TrialLog in
Avatar of Praveen Kumar
Praveen KumarFlag for India

asked on

OOP's in Video Library Management

I am doing a simple Video library management system basing vb.net and access. The transactions include Rentals (Issue/Return) , Sales, Purchases, Membership Regestartion etc.
My question is How i implement Object Oriented Programming approch in this system?
I dont need any links for documents on OOP's. I need a pactical implementation system design. Like Class Definations,Interface Definations, Database design will be appriciated.
ASKER CERTIFIED SOLUTION
Avatar of fffej78
fffej78

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Praveen Kumar

ASKER

Thanks. I will try to work on it. give me 1 day time please...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes friends,

I designed following database.

1. InvoiceMaster - Stores Sales Invoice(InvNo,Cust Name,Address, Amount, Cash, Card etc.)
2. InvoiceDetails - Stores Sales Invoice Details(InvNo,ItemCode,Price,Qty,Discount etc.)
3. MemberMaster - All Members Details
4. CustomerMaster - Non Member Or Customer Details
5. Issues - Rental Issues (MemCode,CustCode,ItemCode,IssueDate,DueDate,ReturnDate,Status etc.)
6. PaymentDetails - All Cash/card payment details (MemCode,CustCode,Purpose,Paid,Cash,Card,PayDate etc.)
7. RentalItems - All Rental Items Details (ItemCode,Type,Title,Language,TotalQty,AvailQty,EntryDate etc.)
8. SalesItems - All Sales Items Details (ItemCode,Name,Desc,TotalQty,AvailQty,CostPrice,SalePrice,EntryDate etc.)

I created a Class for every table, which will do all the required selections/manipulations in the respected Table.
Every Class have Proporties exactly as Columns in the Table.
While Inserting data,  i am creating a object for that class storing values into the properties.Then one function will insert/update the database table.
Some shared members will return rows/values from the database.

Is this is the correct way to implement OOPS in the .net project?

hi  fffej78, your links are useful but i cannot understand them completely at this time(as a student). Your Rental class idea also far away from my knowledge.
if you know any liks for example final Software documentation(OOPs) pls let me know.




Avatar of fffej78
fffej78

Remember that duplication is bad.  Look at RentalItems and SalesItems, they both have lots of repetition in them.

7. RentalItems - All Rental Items Details (ItemCode,Type,Title,Language,TotalQty,AvailQty,EntryDate etc.)
8. SalesItems - All Sales Items Details (ItemCode,Name,Desc,TotalQty,AvailQty,CostPrice,SalePrice,EntryDate etc.)

Let's extract out the commonality

9. Items - Item details( ItemCode,Name,Description,TotalQty,AvailQty,EntryDate)
7. RentalItem( ItemCode, Type, Title, Language )
8. SalesItems( ItemCode, CostPrice, SalesPrice )

SalesItems and RentalItems now both just contain an item code and the information specific to either rentals.

The works in exactly the same way as Issues and PaymentDetails.  In these, you haven't put all of the Member information out, you've just put a reference to the MemberCode.  This process is called normalisation.

Otherwise off to a good start :)

In your OO design, I'd certainly start off by considering a class per table.
"Is this is the correct way to implement OOPS in the .net project?"

Yes, though you should definitely consider what FFFEJ said and remove database redundancy.