Which classes would be suitable in this small system

T

Tony Johansson

Hello!

I hope somebody can give me a hint what classes would be suitable in this
system.
I know one class that I want to have in this system and that is Product.
I have a small description about the system below.

I'm about to design a small system that will administrate a physical shop
that have a little store that will sell media(books, cd/dvd,games and such
things). The system will be used by the people who work in the media shop.
The system will be used both for cash handling (when you sell media to a
customer) and for stock-keeping.

So in this shop we can assume that some people work with the store and some
work with selling products.

The functionality for the system should be:
*******************************
A.Add a new product.
B.Remove a product.
C.Add a new delivery from wholesaler which will incease the number of one or
more particular products.
D.Sale of product which will decrease the number of a particular product.
E.List all product that the shop has.

A product should have the following fields.
Name, Price, and a unique product number

The system should have at least two views.
One view that is used for handling the cash task.
One view for the stock-keeping task

These two view should be working against the same data.
One more thing the data should be stored on file so no database should be
used.

There should also exist some control functions like:
1.You should not be able to add two products with the same product number.
2.You should get a warning if you try to remove a product from the store if
the system say that you have at least one left

The functionallity A,B and C should only be available in the view that
belong to the people that work in the store
The functionallity D should only be available in the view that belong to the
people that work with cash handling task view(sell media).
The functionallity E should be available from both the stock-keeping task
view and the cash handling task view. So this functionallity can both people
that work in the store and people that work with selling media use.

//Tony
 
C

Cor Ligthert[MVP]

Hi Tony,
These two view should be working against the same data.
One more thing the data should be stored on file so no database should be
used.

Then you should use a kind of binary file and in fact create your own
database with own concurrency checking.
There is no Net class available to do that, as this is from before 1970,
where it forever failed and the databases were created.

Cor
 
P

Pavel Minaev

Hi Tony,


Then you should use a kind of binary file and in fact create your own
database with own concurrency checking.

The original statement is self-contradicting. "Data should be stored
in a file" does not imply that "no database should be used". MSSQL
allows to store the database in a file, for example. MSSQL CE allows
to do that without any server at all, fully embedded into the host
app. So does SQLite, and Firebird/Embedded, all of which have ADO.NET
drivers.
 
T

Tony Johansson

Hello!

Have you any good hint which user defined classes would be suitable as a
whole for this system.

//Tony
 
A

andy.johnstone

Have you any good hint which user defined classes would be suitable as a
whole for this system.

I would advise you build classes to statisfy use cases (which you've
listed; add product, remove product, list products).

So you'd probably have a Product, which can create, delete or update
an existing product. A ProductList class. You'd also need another
class which would take a product number and increase or decrease the
inventory amount by the specified amount.

Since you're building a business class library, you may want to check
out Csla.Net. Csla.Net is a framework specifically designed to help
you create business objects and contain rules (like your product
number must be unique rule) and security checks (if you need them,
there is support). It may take some initial learning, but in the end
it would be well worth your time, as it will help make your
application more maintainable, and if you plan on building more of
these kinds of systems, you can take that knowledge with you.

http://www.lhotka.net/cslanet/

HTH!
 
T

Tony Johansson

Hello!

I don't really understand you.
In what class do you mean that I should implement
add product, remove product and list product ?

//Tony

<[email protected]> skrev i meddelandet
Have you any good hint which user defined classes would be suitable as a
whole for this system.

I would advise you build classes to statisfy use cases (which you've
listed; add product, remove product, list products).

So you'd probably have a Product, which can create, delete or update
an existing product. A ProductList class. You'd also need another
class which would take a product number and increase or decrease the
inventory amount by the specified amount.

Since you're building a business class library, you may want to check
out Csla.Net. Csla.Net is a framework specifically designed to help
you create business objects and contain rules (like your product
number must be unique rule) and security checks (if you need them,
there is support). It may take some initial learning, but in the end
it would be well worth your time, as it will help make your
application more maintainable, and if you plan on building more of
these kinds of systems, you can take that knowledge with you.

http://www.lhotka.net/cslanet/

HTH!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top