Skip to main content

a detour into offline messages...

A key feature that I recently added to the collaboration API (about 10 days ago) is an offline messaging capability. If you are a user of yahoo messenger you know how this works, when you are offline users are able to still open an IM window and send a message that you can then read when you log back into the system. I wanted to perform something like this since I finished the main implementation of the collaboration API almost a year and a half ago but I pushed it back , now that I am near the end I realized the 3 days it would take to code it was well worth the potential benefit it would bring to the users (and indirectly to the company!)

The offline messaging allows each User to control who can send them offline messages, unlike the yahoo thick client in which I periodically receive spam messages from users who are not on my contacts list. In my implementation, a User has 4 options that other Users can be given with regard to offline messages:

  • Offline messages disabled
  • Contacts offline messages only, notification off
  • Contacts offline messages only, notification on
  • Any User offline messages, notification off
  • Any User offline messages, notification on

In addition to these options a User has a stealth mode option for when they are online, this allows them to come online silently without notifying their contacts (or any Users browsing profiles) of their presence. If a User is in stealth mode, naturally they appear offline to the offline messaging code and thus are subject to receiving the offline messages while online. This gives them the discretion to do nothing, respond to the User by private message or email. The User Settings page displays the status of Users based on the above mentioned settings, I discovered that the logic was all screwy...the offline notification settings were mixed up and would indicate a User was online when he should have been indicated as offline, when online the display link allows sending a private message as opposed to an offline message even if offline messages are disabled (this was another pathology). After looking into the code I realized one thing quickly, I need to clean up a bit! The conditional statements were not aligned very well, I soon discovered the issue and fixed it. I noticed one aspect of symmetry observant designs that employ method polymorphism and combinations of hierarchical and compositional class relationships is that the savings on the class level can turn into some interesting conditional relationships. The use of simple integers as attribute fields in the classes saves a great deal of code in that the class ends up having many attributes but these various dimensions when put together in the client code inspire the creation of conditional statements to build the desired behavior. Case in point with regard to the problem mentioned above was that several attributes of the user object were conditionally tested to determine which of the links (offline message or private message or conference or eject...etc.) displayed on the settings page, this led to some clauses containing up to 3 sub conditions, though this results in rather imposing looking conditions at first...with proper condition design (making sure to take advantage of short circuiting) this leads to rapidly executing conditions tailored to exit at the rate of highest likelihood given the condition sub conditions.

All that said, I am still noticing a great deal of places for optimization of the code to squeeze it down to as few essential bits (characters) as possible. Since the client code in my framework runs mostly in jsp templates, squeezing down the bits directly aids performance over the distributed cluster in the long run and that directly reduces costs for operating the business...all great things.
Time to get back to the implementation...

Comments

Popular posts from this blog

the attributes of web 3.0...

As the US economy continues to suffer the doldrums of stagnant investment in many industries, belt tightening budgets in many of the largest cities and continuous rounds of lay offs at some of the oldest of corporations, it is little comfort to those suffering through economic problems that what is happening now, has happened before. True, the severity of the downturn might have been different but the common factors of people and businesses being forced to do more with less is the theme of the times. Like environmental shocks to an ecosystem, stresses to the economic system lead to people hunkering down to last the storm, but it is instructive to realize that during the storm, all that idle time in the shelter affords people the ability to solve previous or existing problems. Likewise, economic downturns enable enterprising individuals and corporations the ability to make bold decisions with regard to marketing , sales or product focus that can lead to incredible gains as the economic

How many cofactors for inducing expression of every cell type?

Another revolution in iPSC technology announced: "Also known as iPS cells, these cells can become virtually any cell type in the human body -- just like embryonic stem cells. Then last year, Gladstone Senior Investigator Sheng Ding, PhD, announced that he had used a combination of small molecules and genetic factors to transform skin cells directly into neural stem cells. Today, Dr. Huang takes a new tack by using one genetic factor -- Sox2 -- to directly reprogram one cell type into another without reverting to the pluripotent state." -- So the method invented by Yamanaka is now refined to rely only 1 cofactor and b) directly generate the target cell type from the source cell type (skin to neuron) without the stem like intermediate stage.  It also mentions that oncogenic triggering was eliminated in their testing. Now comparative methods can be used to discover other types...the question is..is Sox2 critical for all types? It may be that skin to neuron relies on Sox2

AgilEntity Architecture: Action Oriented Workflow

Permissions, fine grained versus management headache The usual method for determining which users can perform a given function on a given object in a managed system, employs providing those Users with specific access rights via the use of permissions. Often these permissions are also able to be granted to collections called Groups, to which Users are added. The combination of Permissions and Groups provides the ability to provide as atomic a dissemination of rights across the User space as possible. However, this granularity comes at the price of reduced efficiency for managing the created permissions and more importantly the Groups that collect Users designated to perform sets of actions. Essentially the Groups serve as access control lists in many systems, which for the variable and often changing environment of business applications means a need to constantly update the ACL’s (groups) in order to add or remove individuals based on their ability to perform cert