I've a doubt about use cases, i will explain the case first and then i will make my question and what i'm doing because i wanna learn how to do it right
Soda Machine::
The machine manage 5 types of soda (A, B, C, D and F)
The user have to add the necesary moneys to pay the soda and identify the soda that he wants
The machine admit 5 types of moneys ($5, $10, $50, $100 and $500)
When the amount added by the user is higher than the value of the soda, it will return the change in the same types of money
When the machine dont have the soda that the user wants, it will show a message
Also, it will show a message when the amount is insufficient
Can happen that the user add more moneys that the soda required, it means that for example the soda cost $100, and I add $100 and $50. In that case the machine will return the excess of moneys or give the change of that money
My doubt is in the case of the types of soda and the types of moneys, because i have the use case "add moneys" and i dont know if i have to extends the use cases of moneys ($5, $10 .. etc) and the same things for the use case "select soda". I have this:
Uses Cases expresses high level usage between your system (i.e. the soda machine) and users.
So in your context I would suppressed all unnecessary UCs like "Check Amount", "Give Soda", "Amount Insufficient", etc. which are usage of your system.
And I would also suppressed too much detailled UCs as "A soda", "B Soda", "$5 Money", etc.
In fact cf my proposal below.
Hoping It helps,
Regards,
EBR.
By the way UML has a precise graphical representation so please use it, your diagrams would be easier to understand. I personally use Modelio but a lot of other tools (open source as well) exist.
In addition to what #Red Beard said, the association type that you are most probably looking for is the UML generalization. However, applying it will only make proper sense when you adhere to the UML notation and after getting rid of the clutter. :)
Related
Why do you need to, in many instances, separate or breakdown one Use Case into two or more use cases?
The only reason to split a use case in multiple use cases is to share a significant piece of functionality among multiple use cases by isolating that piece of functionality in a separate use case.
Example: 'search product information' may be a separate use case included by use cases 'buy product' and 'hire product'.
Apart from 'include' there are also examples of the same principle using 'extend' or 'generalize'.
By doing so, you prevent that the shared behaviour is copied in multiple use cases, with the chance of growing inconsistencies.
In the previous example: We want to make sure that customers don't get a different way to search for product information when buying compared to when hiring products. With an included use case, people who read the use cases are immediately aware of that fact.
First of all: you don't. Starting to do that means you are doing functional analysis. The point in use case synthesis is to find the goal(s) (aka. added value) the different actors have when interacting with the system under consideration. It's quite futile to separate a goal into sub-goals at that level. Either you have some added value or you don't have it. So if someone has settled a use case and tries to break it down then the use case is either wrong (no use case) or it's useless since the use case already shows the added value.
My personal opinion about include and extend: they are basically evil and a wrong concept introduced by techies (which most of the UML designers are) with no business background. Using them means you are already starting functional analysis. But UCs are synthesized from requirements. That is, you drag your net through that requirements soup and fish out those that fit together to build a story which makes sense - and which delivers added value: a use case.
And as always: read Bittner/Spence about use cases.
I should choose a recommending system algorithm & simulate it in the field of social network. The only algorithm I could find it's code is slope-one. I have 2 question:
Is this algorithm suitable for social network? If the answer is negative, Would you please introduce me an other useful algorithm?
I don't know, how can I do this simulation? what should I do? & what's it's requirements?
any guide would be helpful, thank you.
1.
Slope One is a really simplistic one, but yeah, you could probably use it. Facebook uses EdgeRank for newsfeed.
2.
As per your comment, what are your requirements/preferences as far as language, framework, etc? If you're open to , if you'll pardon the pun, recommendations, I'd suggest an ASP.Net MVC 3 web project.
Setting up the data will be a matter of setting up a "Person" or "Friend" class (this is assuming you want a friend recommendation -- you could just as easily do this with groups, pages, apps, etc -- your choice). Then, you'll create several (the more the better) instances of that class, with randomized names, properties, etc. Google search random generators for this - I'm sure you'll find something. Or write the code for it yourself. If you can't do either of those, write me back on here and I'll throw together some code for it.
Then, you're going to set up a small-scale representation of a network. That is, define the relationships between your "People". There are several ways to do this, but in your scenario you could probably get away with giving each Person Object a "Friends" property, which holds a reference to other Person objects.
I'm going to leave the algorithm implementation a little more up to you (since this is a scholarly project, I have to let you learn, right?), but here is a little bit of groundwork to get you started:
Using the implementation you showed me, you could set up a class like so:
public static class Rating
{
public static double RatingBetween(Person a, Person b)
{
double rating = 0;
foreach (Person friend in a.Friends)
{
if(b.Friends.Contains(friend))
{
rating ++;
}
}
}
}
This is a very very simple example, but basically it works like this: For every friend of person a, if person b also has this friend, the rating between person a and b gets a little bit better. You'll want to add other scenarios to this (for example, you might add 5 rating if friend a and friend b live in the same city, and 5 for same school, job, etc. Then you can set up a dictionary (or something) of ratings for a given Person, like this:
Dictionary<Person, double> FriendDict = new Dictionary<Person, double>();
foreach (Person a in personYouAreRecommendingFriendsFor.Friends)
{
FriendDict.Add(a,Rating.RatingBetween(personYouAreRecommendingFriendsFor, a))
}
So now you have a table of ratings set up, and you can use the implementation you found to do the rest.
If you need any more nudges in the right direction as you go, I'd be happy to help. Just comment back on here.
Helpful references
Wikipedia Article on Slope-One
Some help with free social networking SDK's -- this may help with defining your network, objects, patterns, etc.
Good luck!
I want to make a basic library management system in prolog. The program should answer queries like which book is issued by which student and which date book will be returned. I want guidance in terms what exact components i need to learn for it (as I am very much new to prolog), i wanna develop it rapidly as i dun have time to learn the whole thing. I will be using visual prolog 7.3
Thanks in Advance
MGD
You haven't given us much of an idea what your programming background is, so I've interpolated a couple of comments below to suggest what existing experience might help in doing parts of the Visual-Prolog application asked about.
With Visual-Prolog you have to begin with user-interface design, something that I frankly found discouraging for playing around with the Prolog coding. Think of the "window" elements you want: perhaps an input field to input a user name and another input field to enter a book title, with some buttons for "search" as your "program should answer queries" spec suggests. The output will contain information about whether a book is checked out, when it is due, etc.
Then the functional part of your design can begin. Visual-Prolog asks you to declare certain things: domains (equivalent to datatypes in other languages) and predicates (the names relations and the domains to which their various arguments apply, roughly the equivalent to routines in other languages).
Your library application sounds like it is similar to a database, a "knowledge-base" containing information about users, books, and the relationship between them (e.g. this user has this book checked out), possibly with some history (who checked out a book when, and when was it returned).
Since you want to "develop it rapidly", you will probably want to start with a very simple set of domains and predicates. Perhaps "user" and "book" are the basic domains to start with, and checkOut/2 the basic predicate (indicating the fact that a particular user currently has the particular book). Then you will probably need to add (at least) the feature of storing the book's return date. This kind of design will be easier if you've done some relational database development before.
Connecting the user-interface (UI) to the "knowledge-base" of library users & books is a matter of writing predicates that serve as event-handlers for the visual elements of the UI. This is somewhat easier if you are familiar with Visual Basic. In any case you can "stub out" the event handlers while you are building the "look and feel" part of the UI, replacing them with substantive implementations as your design moves into developing the "knowledge-base".
I've been developing a piece of software that takes rules of the form 'A Disallows B' or 'X Requires Y' to make an application that will allow you to configure a complex item.
To describe it more fully, imagine you've got a level of folders, which have some number of sub-folders, and each of those sub-folders has some number of items. The intent is to express relationships between the items in a way that helps the user create a valid collection of selections.
So the actual rules look more like 'All(A, B, C) Disallows Any(X, Y, Z)', which states that if the user selects A, B, and C, they can't select any of X, Y, or Z. It's basically just boolean logic.
There are additional types, like those that say if you select A then you must also select B, but it's not worth getting into the specifics of all that.
It's not business logic (at least not in the normal sense), and the rules can change any time (and they will) so they need to be read from a string and interpreted or hooked up through a convoluted database structure (which I'd prefer to stay away from).
The real point is: Is there some sort of system or framework out there that deals in this kind of runtime behavior? I know that Oracle has a thing called the "Oracle Configurator" that does exactly what I'm talking about, but it's prohibitively expensive I think.
The project is almost over, and I've built a "working" system, but I'm trying to do a post-mortem to see if it could have been done better/faster/cheaper.
You might be interested in Prolog.
I believe Oracle Configurator is only a module inside E-Business Suite. It's not something you can just load into an existing database and application.
You might want to check out DBMS_RULE to see if that will do what you want.
Sterling Configure, Price, Quote, SAP Configurator and Oracle Configurator are some of the options out there.
I need to develop a user interface for inputting something like "if x or (y and z) then do a, b, and c". The data to be entered itself is already quite complicated, how do you wrap it up in an intuitive UI?
Here's my answer from a similar question: Intuitive interface for Composing Boolean Logic?
I would break your interface into two parts: the condition and the result.
Here's an example of the conditional interface:
A Few Thoughts
The interface starts out simple
If it gets complicated, it's because the user built it step by step
No editing or drag/drop - just creating and deleting branches
Conditions are a simple dropdown in this example, but could be more complicated or possibly negated. Basically this interface lets you compose expressions.
I think it's a good idea to avoid this type of interface if possible
Here is an example of how I solved the problem for a bug database. This was done a decade ago on a linux box, so the L&F is rather motif-ish, but it shows the general concept:
(source: clearlight.com)
It works pretty much as you expect. You can change "ANY of the following" to be "ALL of the following" and the labels on the subsequent lines will change from "or" to "and". The "IS" button can be changed to "IS NOT" as well as "Matches pattern" and a few other choices.
You click on the +/- buttons to add additional criteria. You can create logical groups which allow you to do expressions like "a or (b and c)", yet it still almost reads like a collection of English sentences.
In your case, instead of an "Order by" section you might have a "do these things" section.
This would be cumbersome to use if you have to create very complex queries, but if you're needing a complex query you're probably smart enough not to need a GUI like this. This was designed more for the casual user for simple ad hoc queries.
I would definitely change the way this looks if I had it to do over again, but the basic mechanics work pretty well.
Will it always be binary logic like this (just Or's, And's, and Not's)? If so you could have the UI be a logic diagram designer, similar to the ones used in designing circuit logic.
This is a good article
http://www.lukew.com/ff/entry.asp?1007
I used the ideas in that article when building a form for entering Benefit Deduction rates. The short of it is, that he recommends building the form kinda like Mad Libs (remember those books as a kid).