?
Solved

Conceptual Class Model

Posted on 2012-08-21
16
Medium Priority
?
755 Views
Last Modified: 2012-08-24
What would a typical Conceptual Object Model look like for a "Tell A Friend" piece of software?

Features include:
Site registration
Login
Import email addresses from Gmail, Yahoo, Hotmail, text file, site textbox, or other
Refer contacts to one or more web pages
Add, remove or edit imported contacts
Receive rewards
Review reward details
0
Comment
Question by:IntelligentResponse
  • 6
  • 5
  • 4
  • +1
16 Comments
 
LVL 29

Expert Comment

by:pepr
ID: 38319985
It looks like social engineering :)
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38320349
Perhaps this pdf could help you design one
http://www.nd.edu/~pbrenne1/ResearchWWW/TechResources/UML/UML2.0.pdf

Classes could be, the user, the software, the references, the things they refer, the contacts, the other sites from where the contacts come, and the rewards.
0
 

Author Comment

by:IntelligentResponse
ID: 38322102
I think the pdf is one step beyond what I need, in other words, I need to know how to get to the point where I can put together a class diagram. So first I need to know what classes and objects this system requires.

I am not sure I understand the list of classes correctly, can you elaborate in more detail please?

Thank you.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 800 total points
ID: 38322170
Now, are you talking about the actual classes in an object oriented programming language or just the classes that represent all the entities involved in the system? My answer was assuming the second one since you used the word 'conceptual.'

There isn't really a single correct answer for this kind of thing. Basically, take every part of the system that you can pull out and show how it interacts with the other parts. Those are your classes. The list I posted was based on my understanding of what your program does. You have a software that allows users to maintain contacts from different social sites and allows them to send referrals referring those contacts to websites and earn rewards, right?

One rule of thumb is to write a description of the system and highlight all the nouns (as I have done above). Most or all of these would be good classes in the diagram.
0
 
LVL 29

Expert Comment

by:pepr
ID: 38322262
A class is the static description of the object of that class. In programming, classes are defined first, the objects are instantiated later.

Objects are used to simulate a system. A collection of classes represents a collection of simulated subsystems. The object simulates the subsystem. The existence of the object simulates the existence of the subsystem (say a student).

Each subsystem has both physical attributes (or other static attributes) and behavioral attributes. In programming, the non-behavioral attributes are expressed as the object variables, the behavioral is represented by methods.

Methods are used or for manipulating the state of the object (changing the value of the member variables), or for interaction with other objects.

When designing the conceptual model, you express the objects and the relations between object using various diagrams. The objects as entities are drawn as circles or boxes, the actions (method activation) are expressed as arrows between them.

When going up one meta level, you do not work with object, but with their classes. For example, the Student is a class that describes zero or more future objects that simulate students.

The UML diagram (the boxes on the mentioned PDF) describes classes with their name, variable names, and method names. The edges between the boxes express the relationship (the possible interaction) and the quantity (one professor, possibly more seminars, etc.)

Usually, anything that can be described by a noun tends to become an object (actually a class of objects). Aything that can be described by a word tends to become a method of a class. You have to think what object is active and what is passive.
0
 

Author Comment

by:IntelligentResponse
ID: 38322439
My apologies for not mentioning it, I am referring to actual classes in an object oriented programming language.

I understand the theory of OOP, but when it comes to identifying and designing actual Objects / Classes Models, I get a bit lost. I believe that the Conceptual Design comes before the Physical Design, and that it is best to understand the Domain in order to achieve a reliable Model, however my research has not produced anything that could help me understand the Domain of a typical "Tell A Friend" type website.

What would the Objects look like (Properties, Methods, Events), and what are the potential Abstractions?
0
 
LVL 37

Assisted Solution

by:TommySzalapski
TommySzalapski earned 800 total points
ID: 38322478
Well, your interface is going to have a lot of classes that depend on what you are using for an interface, but for your actual software, you'd basically have the same classes that I listed. You probably don't need the 'software' one, but I never really liked that one anyway.

You should probably add a contact list class to hold all the contacts (each user object would have one of these).
You might not need a class for the social websites, just methods in the contact list to get the contacts from these sites.
0
 

Author Comment

by:IntelligentResponse
ID: 38322834
So would you recommend the following, or what would you change or add?

Website Class:
Properties:
    WebPage
    Reward
Methods:
    RewardMember

User Class:
Properties:
    Referral
    Contact
    Reward
Methods:
    Login
    ReferWebPage
    InviteContact
    AddContact
    RemoveContact
    EditContact
    DisplayRewardDetail

Contact Class:
Properties:
    EmailProvider
    EmailAddress
Methods:

EmailProvider Class:
Properties:
    Name
    EmailAddress
Methods:
    ImportFromProvider
    ImportFromFile
    ImportFromTextBox

Referral Class:
Properties:
    Name
    WebPage
Methods:
    SendInvite

Reward Class:
Properties:
    RewardName
    RewardDescription
Methods:
    RewardUser
0
 
LVL 29

Assisted Solution

by:pepr
pepr earned 800 total points
ID: 38323748
I higly recommend to read the OBJECT-ORIENTED ANALYSIS AND DESIGN With applications by Grady Booch (2nd or 3rd edition), Chapter 1 Complexity. It is about 20 pages that should be cut to the stone. He mentioned also Five attributes of a complex system (page 10 in the 2nd ed., page 12 in the 3rd one). Basically, he comments 5 citations of others. The fifth attribute says:

“A complex system that works is invariably found to have evolved from a simple system that worked.... A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system"

For your situation, the project is not that easy. Otherwise, you would know everything how to make it work. You should apply the principle to the design. Think in terms: "This simpler design works in my mind. Let's enhance it now."

For example, you may know the test driven programming (i.e. write unit tests first, ...). This is not directly related to the problem, but there is one similarity in what you do not observe yet. The test driven programming cannot be mentally captured in details until you do it. The reason why it works nicely is that it prevents diverging from the goal. In my opinion, this is exactly what is expressed also in the fifth attribute above.

The problem is that it is easy to design a system on paper. What is difficult is to make it working. The reason is that there always is a lot of details that may force you to rethink the initial approach.

Start with the key objects, make the connections as clean as possible, as flexible as possible. Think about how the system would be played in reality, without computers. People are not rigid and they like not to behave rigidly. On the other hand, it is better to know where to find something that I need (i.e. rather fixed interface with the World).

Another hint is (could also be from the Booch book) that when you observe some really complex subproblem (i.e. difficult to capture behaviour), it can help to introduce the intermediary object that helps to solve the problem -- think about specialized agents. Basically, the complexity of a program could be expressed or via complexity of the data structures or via complexity of the algorithms. One have to find the ballance. Both worlds of humen and of computers have their limitations. You, as a human and a programmer have to know both worlds.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38324761
That looks like a great start to me. You'll probably add some more methods as you dig into it such as a logout function for the user. Of course, you probably don't want to reinvent the wheel and can get some free code that will do all the login/logout/password stuff.
As you begin to implement it, you'll likely modify the class diagram somewhat, but it provides a good outline to begin from.
0
 

Author Comment

by:IntelligentResponse
ID: 38328070
Pepr

I think you have a valid point. I read a bit of Booch's Chapter 1 Complexity, and it seems that I might have to start with a simpler approach, but I just don't have the time to go through the essential sections of the book that might help me in the long run. Do you think I should simplify my starting point? How would you change what I have?

TommySzalapski

I like your hands-on approach to the challenge, but despite the fact that I have a starting point, another look at it gives me the sense that perhaps the Website Class should have the Import Methods instead of the EmailProvider Class having them, what do you think?
0
 
LVL 29

Accepted Solution

by:
pepr earned 800 total points
ID: 38328226
I probably do not fully understand the intention. Anyway, there are things that clearly fits to be expressed by objects (classes), and there are things that does not fit with the pure OOP. If the OO system is designed as a set of cooperating objects, there always is a question whether the perception of the objects is... whether it seems natural. You are simulating, say, interaction among people to share opinions and other things. There is a core of the system and there are some add-ons, decorations. There are some means to do the interaction, and the interaction takes some form. The interaction is the noun. However, should it definitely be expressed as an object of the class? Or is the "action" part of the interaction more important? Is the information passed during the interaction the key element? Should that be expressed as an object?

The hierarchy of the system/subsystems can often have meta-levels. It seems that it is sometimes overlooked during the design. For example, is the web server part of the simulated problem, or is it one meta level higher? Is the existence of the web server essential for the design of the model?

I have got my university degree at the dawn of OOP. I was also focused on simulation systems -- here the object view was very natural even in pre OO era. But the OO view to the problem was not that clear as it is now. Anyway, you would find people who were aleady living in the OO world and who actually paved the road. The Simula programming language actually introduced the key OO programming language abstractions in 1960+, and the Simula language was one of the key inspirations for designing C++.

The problem with programming often is that the beginners focus on syntactic details instead of focusing on the ideas. This was not different in my case. It is natural also in more abstract areas as, for example, the mathematics is. Knowing details of the programming language is a kind of essential. However, the key part of programming is a good imagination of the programmer. The programming language is only the mean for expressing the ideas formally, technically. The programming language should be able to express the abstract ideas as naturally as possible. And the modern OO languages are able to do that. The problem is that the programmers still tend to think in the language-syntax terms (so to speak).

The most flexible OOP languages are more dangerous in the sense they allow a programmer to do whatever they want. The problem is that programmers must know what they want to achieve.

Back to the problem. The initial design may be good... or not. It is difficult to say now -- at least for me. Anyway, it is always a good starting point. I recommend to think again about the classes and to choose what of them form the most important parts of the system. Some of them can be only an expression of helplessness (no offence, it is normal). When implementing the system, do implement the key classes first. When designing, do the parallel design of the simplified system first. Build a mental picture of the system, imagine how the parts will interact (no details, just if it works naturally). Draw pictures of the objects and of their interaction -- not UML, not too formal, just circles, boxes, arrows, hastily made notes, a lot of papers... and then look at it tomorrow to distill the esssence. You have to play the actor that lives the Shakespeare's play. You have to feel that what you do is correct, natural. The good criticism now will save you the programmer's work at future. It is much faster to refine and/or change the opinion (the design on the abstract level) than to rewrite a lot of source-code lines.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38329521
perhaps the Website Class should have the Import Methods instead of the EmailProvider Class having them

It's importing contacts, right? So it would make sense for the user class to have that method. What I would consider to be the proper way to do it would be to have an importContacts method in the User class that calls the getContacts method of the EmailProvider class. EmailProvider::getContacts would return a list or array of Contact objects. Then the User would copy these into his Contact list.
0
 
LVL 15

Assisted Solution

by:David L. Hansen
David L. Hansen earned 400 total points
ID: 38329554
Remember there is no "right" way of doing your classes.  There are however (and this is the important part) plenty of wrong ways of doing it.  The pressure of schedule and various stake holder's impatience must be resisted as much as is realistic to do so.  My point is that when 30% or less of the project's efforts is put into coding and the rest goes into design and testing, you will greatly increase your chances of success.  I've seen it over and over.  In my opinion, doing this is the hardest part of our discipline.  It is just way too easy to bow to impatience of others or yourself, and just start coding.  Resist that temptation, it is not your friend.

I think you are off to a good start; take pepr's advice and refine what you have on paper first...be critical of it, think it through.
0
 

Author Comment

by:IntelligentResponse
ID: 38330057
Thanks everyone, you have each helped me here, appreciate it.
0
 

Author Closing Comment

by:IntelligentResponse
ID: 38330684
Thank, each of you have helped me gather my thoughts about this problem, and I am ready to move to the next level of discovering the Model I will need.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Progress
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question