Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    goqp
    @goqp
    Could be by organization.
    The list of attributes is pretty large.
    Paulo
    @ptrecenti
    in the case of email it's unique and could define the identity of the person, but not the name (first, last, soon) because many people can have the same last name and this will return to me a list of people
    but I really don't know how fit the requirement to filter by last name (for example) without do what I made in the people class to filter by last name without rewrite the iterate method or use filter like the organizations
    goqp
    @goqp
    what I am saying is finding a person by email is a special case of finding some subset of people by any criteria
    whats the difference? None.
    The fact that the email is a unique mapping to a person is irrelevant.
    See, if you are looking for a person you have to stick with the person object.
    But if you are looking for potentially more than you just need a list that sorts on any criteria you specify.

    Paulo
    @ptrecenti
    ok, how could I deal with the fact to do not load the entire database and apply this criteria without re-write the iterate method?
    goqp
    @goqp
    Wait, I think you have solved the problem but your objects are like machines, not models.
    You need to strip them down and repackage the code.
    Paulo
    @ptrecenti
    I've tried to create a strategy to do that but I thought that it's going to a wrong way too
    goqp
    @goqp
    It was because you had helper objects for filtering inside of your list object.
    that isn't right.
    First of all. The list of people is a thing that we are modelling. Right? So it has a coordinate to a real world target (the database), which as all of the needed information about this list.
    So, the coordinate is the sql that the databse will use to create a temporary file (the result set of the query), that will then be read by the people list object.
    Right?
    Paulo
    @ptrecenti
    ok
    goqp
    @goqp
    So then, you have a list called FilteredPeople. Can you make JUST that for a second?
    When you ask filteredPeople for his iterable, he will return you a static snapshot of his people at that point in time.
    this should be some kind of ArrayList of people that implements iterable<People>
    You could, of course, make a filteredPeople list that actually iterates over the people by going record by record, but this would be really unstable.
    Paulo
    @ptrecenti
    yes
    goqp
    @goqp
    FilteredPeople only promises to tell you what he knows at one time. He doesnt know that the people he is aware of may have been deleted in the interim before you tried to navigate to one of them.
    He doesnt care.
    Actually, the best way to do filteredPeople is like this:
    new CachedPeople (  
     new FilteredPeople (
      database db, 
      string criteria
      )
    );
    Paulo
    @ptrecenti
    ok fine this the same idea of a super object like the organizations class that I show to you
    but I got your point
    thank you very much @goqp you help me a lot I really appreciate your time
    :thumbsup:
    goqp
    @goqp
    Awesome! Is it all clear then on how to compose the vertical decorators for the people list, and when to just use a person object rather than a list of people?
    Paulo
    @ptrecenti
    The problem i think is the of my objects
    Yes is pretty clear to me
    goqp
    @goqp
    Ok excellent.
    Paulo
    @ptrecenti
    You really help me
    goqp
    @goqp
    Try this rule of thumb: if the object looks "cute" and tiny, then it is okay. If it looks like a complex machine with lots of gears and parts, something is wrong. Refactor into smaller objects.
    Thanks, very glad I did !
    Each object should be a lightweight model that is mostly made of "air". The air is the (imagined) space in the text file that you literally write the code. Make sense? Here is a visual representation:
    { a,b } --- { a,b,c } ----- { a } ------ { a,b,c,d }
    Now here is what you dont want:
    { a,b,c,d,#e,%$#@,g,h,hi } --- { a,b,@%#^c,x^y,z } ----- { a@%,d,l,e,y,m,e^ } ------ { a,##%^^^b,c,d,d,v&#@@h }
    LOL! See...
    Paulo
    @ptrecenti
    LOL hahahaha
    good metaphor
    goqp
    @goqp
    :)
    Luca Guadagnini
    @tryIO

    @try io > and pay attention about prototyping, it's not easy to extend an object, unfortunatly it's much worst than you think:

    oh I agree remember? I said its complicated and confusing. But the nut cases that developed prototyping for SELF thought that it would be an easier alternative to classes, they said so.

    of course, I just wanted to show better the hell behind, extending a prototype object to anyone :smile:

    goqp
    @goqp

    Object thinking for BUSINESS:

    So as you may know I work in business not software development. Recently I have been applying object thinking to help me organize and direct my operations. This is especially important because I have memory problems and cant remember a lot of small details accurately or for very long. One strategy I am using, is to encapsulate actions with a short time-frame within the action item. So, for example, when I get one or several short-time-frame actions (like emailing a document to a client, preparing an invoice, etc.), I grab the relevant file (or make it) and write down a memo listing the actions. Then I put it in the inbox and FORGET ABOUT IT.
    ....
    Now the entire set of actions (i.e., the behaviors) that need to take place are encapsulated inside of the folder (i.e, the object), and are not visible to the outside (i.e., I forgot what to do). I dont need to remember what actions to take or use a master control list to track the actions. The short time frame means that they wont be relevant for very long, usually not longer than a few hours. They also change quickly. When that happens, I grab the folder, make an edit, and then re-file it in the inbox. While this method is more laborious then one would desire, it is cognitively much less demanding and makes it possible to manage large amounts of important information without burning out.