Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


UML... How to program a control class?

By il11ry ·
Hi all
I know that each use case has at least one control class
that handles computations, algorithms, and validation
operations but how could we implement it
for example let's take the login use case as case study,
there will be boundary class with the following attributes:
and there will be an entity class with the following
-password and some of get and set functions...
but what about the control class what does it handle??
does it has attributes ?? and what is the nature of methods
inside it??
I will appreciate anyone who can put an example that
illustrates how to implement the control classes in java or
c++ or

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by Tony Hopkinson In reply to UML... How to program a c ...

Login and Logout.

the rest of it, well depends.

If you cart password about (in plain 'english'), you need to be really careful about where and what can access the entity. It would be better to have the control class take username/password as parameters and return a user with an authorised flag.
Then any secured operation would expect an authorised user to be input and check that, as an input condition.
Whichever way you go, don't be carrying password about all over the place.

Collapse -

Another help please

by il11ry In reply to Hmmm

well ... could you post a sample code or prototype about how
to Implement boundary, control and entity classes for login
use case just to make the idea more clearer to me.
Another question plz...
Is it true that entity class handles for example ADO.NET code
in case we wanna connect to database system to make some
I will appreciate any help

Collapse -

I don't do I'm afraid

by Tony Hopkinson In reply to Another help please

google and uml, you'll get some examples.

As for putting your database stuff in the entity class. I've done it and seen it done and it can work, but there's a cost depending on what access to the db you need.
If you are 1 to 1, ie customers class is the only one to access the customer table and you are unlikely to want to change which database you are sourcing from, say you want to use both sql server and Mysql as backends, then it's a goer.

Personally I prefer to have a class that does all dealing with the Db, and implement it through an interface.

So the you can have an interface method called getCustomers which takes some parameter and returns an aggregate of customer instances and implement it in SQLDBClass.

That way all your sql is one place, you can keep all your connection stuff in there as well. Then if you make it part of a library you can swap in another backend simply by swapping the dll.
It also gives you the oportunity to say , go for file based xml system etc.

Something as superficially simple as renaming a table, if that table name is 'all over the place' can become a very comple task. It will happen, pepare for it.

I recommend you look up the MVC pattern, it tends to fit very well with straight client server database applications.

There's no rocket science to implementing UMlL diagram as a .net class by the way. It's just a class, nothing special about it at all. Whether you can or not depends on your knowledge of the language and the quality of the UML. Whether you should... well, that is scenario specific. Just because it's described by UML, doesn't mean it's correct or practical.

Related Discussions

Related Forums