UML for a business rules - uml

I want to create a class diagram UML for a part or bundle of my wbesite. This part contains three sub-parts :
Job : I want to show a list of jobs by date (title, date of job, location, deadline)
When I click on a job in list, I hope to have details of the job (title, description...)
Administration of list of jobs (delete, create, edit...)
I can imagine the template of view to create it but I hope to create a class diagram UML for Business Rules (class abstract,method,object...) to use after I create my code.
I'm not very professional in UML. Can someone give me an exepmle of graph or schema to create it, a prediction for method and object to use it in template.

Here is an example from some of my old college coursework. It may be of some use. Sorry if I can't help you further as I too am starting out professionally.

Related

Class diagram for a mini JEE project

I want to start a project in JEE and I need to confirm about my class diagram. I need to know if the methods used are correct and if the composition I used is correct or not.
This is my class diagram:
The project is about an online sales store, that wants to set up a management tool to sell products, and to manage its products. This tool must include the following features:
Identification module: identification of clients, managers, supervisors
Sales module: make purchases for users
Product Management Module: Adding / Deleting Products
Statistical module: visualization of sales statistics
Functional Specifications
It is necessary to act on the application, to connect to the application with a user ID and password. To facilitate its use and in order to avoid any mishandling thereafter, here is the solution:
User Profile:
The user will be able to visualize the products sold by My Online Races. The user can place an order, provided that he has registered with the site My Online Races.
Manager profile:
The manager will be able to manage the products:
Add / Edit / Delete Products
Add / Edit / Delete category
These data insertions can be made using CSV or XML files, but also through various forms on the website.
The manager will be able to view the sales statistics.
Supervisor Profile:
The supervisor can add managers whose roles are specified above.
The supervisor will be able to view the sales statistics.
The supervisor will be able to view all the actions performed by the managers, a sort of audit trail.
Well I wish to know already if you have remarks about my design. As well as I have a confusion for several methods, for example adding, modifying and deleting a product. Should I put them in the manager or product class? Is the composition I put correct or should I remove it?
Quick review of the diagram and advices
First some minor remarks about class naming: Ordered should be called Order.
The composition between Article and Order is just wrong (not from a formal view, but from the meaning it conveys). Use a normal one-to-many association: it would reflect much better the real nature of the relation between the two classes. Please take into account that a new article may exist without having been ordered, so it shoud be 0..* instead of 1..*
+belongs and +do in the middle of an association are syntactically incorect. You should use a plain triangle instead (or nothing at all). The triangle should be oriented in the reading direction Person do |> Order and Article belongs to |> Category
The methods seem ok. You do not need to add a suffix.
How shall objects be managed (created/updated/deleted) ?
A more advanced concern is not about the diagram but about how you want to organise persistence (i.e. database storage):
do you really want the object to be an active record, that is an object that adds, updates and deletes itself (to the database) ? It's simple to set up, works well, but makes the class dependent on the underlying database implementation and thus makes maintenance more difficult;
or wouldn't it be better to use a repository for each object ? In this case the repository acts as a collection that manages all the database operations. The domain object (Article, order, User, ...) then have nothing to know about the database, wich leads to more maintainable code.
But this is a broader architectural question. If it's just for a first experimental project with JEE, you can very well use the active records. It's simpler to set up. Be sure however in this case to disambiguate the Add/Update/Delete on Person, since it currently may give the impression that any person can add anyone.
Improvement of the model
A final remark, again not about the diagram itself, is about the domain. Your model considers that an Order is about a single Article.
In reality however, orders are in general about one or several articles: if this would also be the case here, your Order would become an OrderItem and the real Order would be inserted between Person and OrderItem. You could then make the relation between Order and OrderItem a composition (i.e: OrderItem is owned by Order, which has responsibility for creating its items, and the items have no sense without the related order).

Is there a better way to represent this Sequence Diagram for a Employer-System-Applicant Scenario?

I've been asked to make a Sequence Diagram for a Casual Employment System in which includes mainly the Applicant, Employer and System. Following my Use Case and Class Diagram, I have used the info I Have to produce a sequence diagram for the Applicant which I have been assigned as actor. My teacher came up with the following comments:
Frames can only be alt, opt or loop.
You can't have multiple arrows into the same activity bar.
It looks like applicant and employer are humans. sequence diagrams are of software not humans.
There is no method name for the driver method on the left.
There is only one participant for the software "System". You need to have many participants each is a class.
My question would be:
what other participants can I have besides the "system" for the Applicant to interact, what other classes can I make?
User Story:
As an applicant, I want to be able to
create an account so that I can apply/search for available jobs.
create a job preference so that I can work in my desired field.
update my employment status.
change my job preference.
create and modify my availability regularly so that my work time will cope with my personal / school schedule.
add or update my employment records.
add or update my reference.
upload my CV online.
select my interview time, IF I get an invitation to an interview (for shortlisted candidates ONLY).
accept/reject job offer.
make a complaint about my employers if necessary.
If you know how to create a class diagram: take the classes in that diagram.
If you know an object-oriented programming language, take the classes you would have in the software.
Otherwise, look at the nouns in the user story: account, job, etc. These will be classes. Some nouns are not classes, but just attributes of classes: desired field, employment status etc. You may ignore these.
All these classes are part of the system. Do not include System as a participant.

Add database and interface CRUD functions to class diagram

I am creating a class diagram.
Process
1)Read Employee data from Active Directory
2) Add Employee detail to SQL Employee table
3) Read Details from XML file and update SQL table
4) update the employee detail in active directory
I have created a class for employee , XML file and a class for Linq to SQL crud functions and another class for the Linq to LDAP.
Question
I am not sure if i need to add all the crud operations and logging functions into the class diagram
It is impossible to answer your question unless you provide more information. Do you have any specific design rules which tell what needs to be specified in the class diagram and what doesn't need to be specified in it? If there are no such rules, I would first consider adding the database layer functions to the class diagram and if the class diagram becomes too complicated then perhaps consider removing these.
This might be a good moment to have a discussion with the other team members what rules are used to make the class diagrams. What do you want to be in the diagrams and what can be omitted? If different persons have different opinions, then this conflict needs to be resolved somehow quickly because it's not a productive use of people's time to keep endlessly arguing what should be specified in a UML class diagram.

Entity relationship modelling, comment on my ERD

Note: Due to low reputation I can't post images so i have added the links accordingly.
I have this assignment I'm working and I am stuck in a recursive relationship, following is part of the case scenario that I am currently modelling;
Now, from the first Three paragraphs i have deducted the following business rules;
Employee is allocated ONE branch and a branch employs ONE or MANY employees
Each branch is designated ONE manager and ONE assistant manager
Employee is managed by ONE manager and supervised by ONE assistant manager
Employee submits ZERO, ONE or MANY previous employment records, a instance of a record is associated to ONE employee only
Employee is assigned ONE job position only, a job position can be assigned to ONE or MANY employees
(note: I have assumed in rule n.2 that a branch is also designated an assistant manager)
And now this is the ERD diagram for the above rules;
So from the scenario, the assistant manager only supervises the staff, but it does not say that it has any relationship with the branch entity, however i assumed that a branch should have a relationship with the the manager and the assistant manager, but i am a bit confused so i havent added it yet to the erd diagram. Can you guys help me out?
Firstly it appears you seem to be drawing a UML Domain model not a ER diagram. These are not the same thing. You've identified an employee but seem to be trying to use it polymophically for all things. This premature optimisation (and for re-use), when you should be following the rules of normalisation of entity relationships. Take a step back, create tables for manager, assistent manager and employee. Add the fields to those, THEN try to normalise.

Developing a UML activity diagram for a search application

I have to create a UML activity diagrams for a searching application for a semantic database.
Easy to guess, users can search and select a file, but they can also browse and refine the retrieved results by clicking the categories the results belong to. They can even select a file just by browsing without actually entering any keyword.
Should I create one single 'large' activity diagram showing the different possible workflows or a series of smaller ones, such as "perform a search", "browse the collection" or "select a file"?
I think, what you have mentioned is more likely to be a sequence diagram ("perform a search", "browse the collection" or "select a file"), and I would recommend you to have several sequence diagrams that you listed. My argument for this is: these diagrams are consumed by testers at design stage, so they can write tests for it.
And the major activities you can put into overall activity diagram, that will show the possibilities of what user can do at a given step/stage (if I can logged in, I can perform a search, browse the collection, etc).
Personally I would create a large UML providing an "over-view" of functions that are provided by your application. I would then create smaller more detailed UML diagrams so that the application's functions can be studied in detail.
Hope that helps with your decision.
Regards,
Mike.
Edit: I find Microsoft Visio particularly useful in which to create the UML diagrams too.

Resources