General discussion

Locked

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
programmatically??
for example let's take the login use case as case study,
there will be boundary class with the following attributes:
-userNameTextbox
-passWordTextbox
-loginButton
and there will be an entity class with the following
attributes:
-username
-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 vb.net
Regards

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Hmmm

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
queries??
I will appreciate any help

Collapse -

I don't do vb.net I'm afraid

by Tony Hopkinson In reply to Another help please

google vb.net 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.

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums