Wednesday, March 26, 2008

Why I joined Microsoft?

So I finished school, joined a big corporation, received my first 3 paychecks and settle down. Honeymoon period is over...Now I can reflect why I joined MS Office Live Workspace.Even more...why as a Program Manager when I'm a hacker at heart?

The main reason is that I got a little bored of coding. I used to think that I am really good at it, and enjoy it a lot, but just didn't get the kick out of it as I used to. I love writing code because I like to see the program do what I want it to do. The problem in my career was that I had to do what other people wanted the computer to, even though it didn't make sense to me sometimes.

In consulting companies, the decision was left to the client, which normally didn't care much for technology. This made my coding experience miserable. In product companies, the role normally falls to a Product Manager. Product Managers tend care about the product itself but are sometimes too focuses on the marketing aspect, pricing and other stuff that don't necessarily translate into what the product should do.

In Microsoft, there is a special role called Program Manager that is responsible exactly for this middle piece of deciding what the software should do, without actually be responsible for coding it. This role objective is to translate (or parse) the costumer needs, which can be captured by a Product Manager, to a working software. Additionally, this role need to be able to make sure that all the parts are collaborating correctly to deliver that vision, without actually having the power of a programmer to code the things you would like.

So far I'm happy and excited, although I feel sometimes the weigh of the Microsoft culture on me. It is difficult and irritating to work on some ideas and suddenly realize that they don't fit nicely with other people's items, and as a result, PM's compromise their work just to make sure their stuff get in, sacrificing the end product in the process. I guess this is the really challenge after all..getting people to do what you want them to do :)

Monday, November 19, 2007

Ok, so although this is a 2006 picture, I still used the same costume as last year. I haven't yet posted the pictures on picasa and I also created this entry just to keep the blog a little bit alive.

Tuesday, August 14, 2007

Paintball

After finishing the summer semester, I organized to go with my friends to go and have a team-building experience: paintball!. I had never played this "game"before and was a little anxious about it, and I think all my other friends were as well.

We drove about 20 minutes out of Pittsburgh and arrived to this outdoor field full of nice props. It was raining throughout the trip so this would add some interesting realism to the game. After getting our gear (a gun an a mask) we were explained the rules of safe playing and where taken to our first game. The game consisted of one team trying to run uphill through a forest and reach a fort where we had to plant a flag. The other team had to stay in the fort and repel the attack. I was in charge of taking the flag.

After we reached the top of the hill we started getting shot at. I remember that I was worried about that point if I would "get into the game" and duck into the bushed and dirt. Ohhh boy did I crawled into the mud. After trying various strategies, we decided that I was going to have covering fire to help gain a higher ground. After I started running I received my first shot ever. In that particular moment you know if you like the game or not. The pain lasts only about a second, but I didn't care, all I wanted was to get there again with my team.

We played all afternoon in different scenarios: old scrapyard, inflatable obstacles, etc. Some had different rules like trying to get the other team out while others where more strategic in which you had to capture the enemy's flag.

I've posted some pictures (others are available here), but you have to get a feeling of what it is like to have 14 Software Engineers trying to shoot each other. Everyone has a strategy and think they are the smarter player, until they get a couple of shoots out of nowhere. Then every team start getting their own natural leader that organizes the assault and trusting the wisdom (and firing coverage) of the group.

All in all, it was an amazing experience and I had a blast. I can't wait to go play this again.

Thursday, August 09, 2007

Summer capstone project finished!

Wow!! I thought this day would never come. Today, the last day of my summer semester at the Masters of Software Engineering, we presented the project in which me and other 4 people worked for the last year.

I've been involved in many projects as developer and manager, and I this has been the best project I have ever delivered: on time, on quality and above scope. I must say that some of the techniques learned in the program has helped me as team lead to achieve this goal. Off course, this would have been possible without my team mates. All exceptional individuals.

So, if you are curious, the presentation slides can be found here (hope the stay there forever):
http://dogbert.mse.cs.cmu.edu/MSE2007/Studio/EOSP_S3_Slides/SOS_S3EOSP2007.ppt

Unfortunately, my semester is not yet over. In a couple of hours I have to go take a Data Mining exam. Then I''m done and I'm off to celebrating this rough year.

Friday, August 03, 2007

A picture from CMU

I was thinking that I have never posted any picture on my blog of my time in CMU. I found this nice picture of last year's Fall when my girlfriend (now wife :)) came to visit.

What you can see in the picture is on of the areas Carnegie Mellon. The small building behing me is called Hamerschlag Hall. The long towering building behind it is the Cathedral of Learning, par of the the University of Pittsburgh.
Posted by Picasa

Almost there....

Well..its 4:30 am and I'm still awake. After a long year of pulling all nighters I'm starting to feel dizzy. I need a break and I need it soon. This last couple of days, knowing that the end of the semester is near is making every day more difficult.

After this semester I will start pointing my guns in a new direction:finding what to do after CMU. Although, as my mentor says, I'm like a kid in a candy store here at, I want to go back to industry. The ideal setting would be to find something research-like. Lets see where the tide takes me in the next couple of months.

Monday, July 30, 2007

Interesting summer semester

Even though I promised myself to write more I can't seem to find time.

Well, its my fault. After all, as a grad student in the MSE program you are supposed to take at most 60 unit (a unit is computed as the average hours per week required in the course) but I got greedy and took 72 units. I couldn't help it. Too many interesting course and opportunities to venture into unknown territory.

Ok, here are my courses this semester:
  • Studio III(48 units): this is a core course. After 2 semesters or designing and preparing to create a search-and-rescue simulator for our client (DoD L3-Communications). Last semester I was chief architect and this semester I've rotated to the role of Team Lead. The project was delivered on time and exceeding our client's expectations.
  • Statistics: (6 units): I took this course mainly as a refreshed to take data mining later on
  • Data Mining (6 units): This course, although interesting lacks the depth I was expecting. We are learning classification methods and different techniques of data mining, but it lacks the mathematics in-depth that I was expecting to learn. At least I get a good hands on with some cool tools that I will be able to use later in my life
  • Product Management in IT: I took this course so in the future I'm more adept at communicating with this group in a company. I was also curious to see what the responsibilities of a PM are, like building Product Marketing Plans and Strategy Plans...interesting indeed.
  • Independent Study-architecture evolution (6 units): this turned out to be pretty cool stuff indeed. A new group within CMU was formed lead by Dr. David Garlan. The group is in its initial phases and we are currently reading possible papers regarding the evolution of an architecture through time. It deals with how to reason about changes and what techniques and method exists to help this transition. This group was interesting not only because of the exposure of the people involved in it, but also because it helped me articulate my thoughts better. As my first splash into academia, I found it to be very challenging and entertaining at the same time.
Next semester I'm going to take it easier, maybe 36 units and audit the rest. No more stress and all nighters. I've been doing this for a year now and my body needs a rest (and the fact that my wife haven't seen me in a while :))

As a glance of what where my past courses:
  • Managing Software development
  • Formal Models
  • Methods: deciding what to design
  • Software Architecture
  • Managing Intellectual Capital Intensive Businesses
  • Real-time decision making with ERP
  • Developing Star performers
  • Analysis
  • Studio I & II
See you!

Monday, February 26, 2007

Back to life

So, after about 6 months of feeling the pressures of life of being a Carnegie Mellon student I've decided to put some time aside and write a little bit of what is going on.

Since I'll be here for another year I guess my thoughts will be mixed between the difficulties and daily chores of a grad student as well as some insight of the new stuff I learn.

Regardless of who reads this, it will be nice to see my thought down the road when I'm older.

Sunday, July 30, 2006

Thinking about view objects with DDD

Continuing a discussion that started in the DDD forum about how to display object in the UI layer, and a post from Sergio about his solution using the Builder pattern, I wanted to add a few thoughts to an already interesting issue.

First of all, I admit that the use of a Builder pattern doesn’t strike me as the best overall solution to all the view objects problems, but I liked the separation of concerns that it conveys. I would tend to keep the code away from the Façade because for me, the Façade is merely an entry point and a coordinator.

Maybe we could solve this problem as with any other domain related problem. I think we are guilty of focusing too hard on technical issues and wanting to solve the problem with a silver bullet instead of realizing that this is simply a different domain in which we, as developers, are the domain experts. Perhaps we have should try to face this issue having in mind that our existing model (Employees and Office) and our screen requirements are the data we have about this domain. In this context, each use-case (or screen) has the information necessary to help us build a model: a model composed of view objects and some sort of repositories (Sergio’s Builder?).

In several projects I was involved in it always surprised me how little one screen reuses view object code from the next (or most code except for UI components). It was like each developer coding a screen was living in complete isolation from the rest of the team. Perhaps giving the problem a more DDD approach we could start having a more supple design to this specific problem. At this stage, the use of a Builder pattern (or other pattern for that matter) could start to arise as deeper insight into our model.

Summing things up, I don’t think we will ever reach a consensus on what is the “best way” of solving this issue. Some UI domain will be better solved with a particular model subset, while other will not. Sergio’s solution is an already digested solution to his domain but it isn’t fitting Jesse’s needs any more than a generic Cargo Shipping model (like the one in the book) would fit a real cargo company software. Nevertheless I will keep Sergio’s proposal (as well as others) as Patterns and/or starting points to address my future UI domain modeling.

Tuesday, July 11, 2006

Injecting into domain objects

As a proponent that a model should be rich and expressive I struggle in most project to avoid the anemic domain model anti-pattern. The post will use Eric Evans domain driven design terminology.

I've sometimes participate in DDD forum and the some of the most recurring question is whether using Repositories (aka DAO but from a model POV) inside Entites is a good thing. My belief is that most of the time it is a necessary thing if you want to avoid using services for everything but the simplest of operations inside your model. So if your are using an ORM and Spring (defacto web app architecture nowadays) the problem arises on how to inject the repository implementation (the DAO implementation) inside the instantiated objects hibernate or another ORM is doing the instantiation instead of Spring. I will not detail on how to do this but just point to 2 blog entries that explain this better than I do.

If you are using the newest Spring 2.0 this issue is actually addressed and is explained here and here. There are some things to note if you're using hibernate.
If you are using an older version on Spring you have other options which are discussed here

Hope it helps someone out there. I know it will help me again to have the information readily available here :)

Wednesday, July 05, 2006

Custom data exception with Spring + hibernate

Today a colleague of mine (Poli) came asking for a way to convert error codes produced in stored procedures in an Oracle legacy database. The project was using hibernate and spring.

Out first reaction was to dig into hibernate and look for mechanisms to intercept exception but unfortunately neither hibernate interceptors or the new event system has support for a onException or onError pointcut. We quickly turned to spring and realized this was actually a better idea since spring already does it own convention of multiple exceptions into its coherent exception hierarchy.

What we ended up doing was this:
1) Create your own exception. Lets call it MyCustomException (what and original name)

2) Copy sql-error-codes.xml from Spring source to your classpath.

3) Modify the copied sql-error-codes.xml and add your own entry in the database dialect you are using (MS-SQL, Oracle, etc). We added the 20999 code to Oracle so our bean definition looked something like this:



<bean id="Oracle" class="org.springframework.jdbc.support.SQLErrorCodes">
<property name="badSqlGrammarCodes"><value>900,903,904,917,936,942,17006</value></property>
<property name="dataIntegrityViolationCodes"><value>1400,1722,2291</value></property>
<property name="cannotAcquireLockCodes"><value>54</value></property>
<property name="customTranslations">
<list>
<bean class="org.springframework.jdbc.support.CustomSQLErrorCodesTranslation">
<property name="errorCodes"><value>20999</value></property>
<property name="exceptionClass"><value>MyCustom</value></property>
</bean>
</list>
</property>
</bean>


Note the use of CustomSQLErrorCodesTranslation to set a special bean we will look at later. Later you input the errorCodes that you should trap and the exception it should throw. What puzzeles is why I need to copy the entire sql-error-codes.xml. Maybe someone can check if this actually is needed or not.

4) In you hibernate respository or DAO make:
a) If you make use of Spring hibernateTempalate and callback Spring will automatically wrap you exceptions. It will look something like this (in this case I’m not inheriting from HibernateDAOSupport from Spring that should make this could simpler)


public Collection loadProductsByCategory(final String category) throws DataAccessException {
HibernateTemplate ht = new HibernateTemplate(this.sessionFactory);
return (Collection) ht.execute(new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Query query = session.createQuery("from test.Product product where product.category=?");
query.setString(0, category);
return query.list();
}
});
}


b) If you don’t use callback you’ll have to tell Spring to do the exception convertion explicitly like:



public Collection loadProductsByCategory(String category) throws DataAccessException, MyException {

Session session = getSession(getSessionFactory(), false);
try {
List result = session.find("from test.Product product where product.category=?",category, Hibernate.STRING);
if (result == null) {
throw new MyException("invalid search result");
}
return result;
} catch (HibernateException ex) {
throw SessionFactoryUtils.convertHibernateAccessException(ex);
}
}


As you can see, there is a call to convertHibernateAccessException that converts the hibernate exception to the defined Spring hierarchy.

Now you can have typed exceptions thrown from your repositories instead of nasty generic Hibernate or JDBC exceptions. Have fun!

Monday, July 03, 2006

Cell phone carriers opening their gardens

It seems that we weren't so behind in South America vs. the US in matters of cell phone openness. It seems that in the US carrier also had a closed garden infrastructure like in other parts of the worlds fending off would-be startup to use their network to create new products to post content online.

A recent news has shown that at least this is changing an several 2 startups Q121 and Rabble are already taking advantage of this new scenario to create a better improve social networks using mobile phones. In an interesting analogy (similar to a previous link of mine) the article goes on saying that 'This "walled garden" concept harkens back to the closed dial-up computer networks of yesteryear, such as AOL, Compuserve, and Prodigy'

This is a great step forward for the mobile phone to become the next computing platform.

Sunday, June 11, 2006

1st class - distance learning

Believe it or not I'm a student again. Classes have begun for me in the form of distance learning. This is the first course of CMU's Master in Soft. Engineering (and the first distance course I ever take in my life). The course will be about the Personal Software Process (PSP), basically a way to measure one's personal effort and improve on it. It draws on the basics of the CMM and applies forces you to log your coding, design and testing time, defect types and where they were fixed etc., un hopes of doing a better job at estimating your future development efforts.

For the course I was given a DVD with recorded lectures that I have to watch on certain days with addition to reading some chapters from the "A Discipline for Software Engineering" from Watts Humphrey. Every week we also get into a java based virtual classroom where we basically chat and ask questions to our instructor. So far there has been nothing really new except some statistics. Hope it gets more useful down the road.

Wednesday, May 17, 2006

PSP distance learning

I thought I would be able to rest these couple of weeks before going to Pittsburgh to study but it seems I have to start studying before that. Actually I started taking the dust of my learning-mode brain and read a few book on discreet math and a bit of algorithms, not too deeply, but just to review a few forgotten things and refresh mi mind and help lower the shock that will be studying again 24/7.

But is seems CMU is going to give me a hand and throw a distance course my way that is to start on may 29th: Personal Software Process. I already received a DVD with distance lectures (videos) and bought the book; what I peeked so far looked interesting.

Thursday, May 04, 2006

Sending papers in

What a busy month this was!!

After receiving CMU acceptance letter I had to go and get funding, plan a "what if" scenery with my personal life (read girlfriend) and how to make a clean exist out of my current employment, so I had little time to write. Also, MSE program director David Garlan was visiting Argentina so I got a chance to be up close and personal with him. For those who don't know him, Dr. David wrote several books on software architecture, formal methods and other interesting stuff besides being a very avid tango dancer. He is a very sharp and interesting person to talk to.

After much discussion with other international students I got to realize that financially speaking, one has to get enough money to start college and plan on getting funding along the way in order to finish it, instead of coping with the entire cost of the program at the beginning. After the first 8 months, most former students seem to agree that a student loan, even without a US co-signer, is possible (but with a higher interest rate). So thinking about college as an investment, I have enough to start it but I’ll have to figure out how to finish it along the way. Once I’m out I’m hopeful I’ll be able to repay my debts. So after sending in most documentation all I have to do is wait for the I20, a special form sent by the University that allows student to obtain F1 visas to study in the US.

To close this posting, I received today an email about some distance course preparation before attending campus that is supposed to start at the en of May, so I'll keep writing on about that in the future. Right now I'm really scared on how all this will turn out hoping I'm making the right choice. Of course, I'm aslo very very excited to start...what a contradiction right?

Tuesday, April 04, 2006

Java from Scratch - part II

A few week back I posted about how long it was since I've built anything with java from scratch. What I want to do in the long run is to produce a DDD oriented projects with hibernate+spring. Bear in mind the last time I used java was with EJBs and JBuilder 8.

So after reading about the myriad of different options that are in the Java world I decided not to try to configure everything for myself and instead rely on a "template" project that would help me. I went with AppFuse to kick start the project since it comes with a mixture of framework decisions you can dream of, from hibernate, IBATIS, Spring and others to JSP, Tapestry and JSF for presentation with included security, transaction support and even AJAX..

So here are the dummy proof steps I followed:

Getting started: Java, Ant, Tomcat and MySQL

The first thing is to download and install the JDK 5.0 in your local computer. For windows there is a simple installer that you can get from Sun's Java site. Try and find something like "Download JDK 5.0 Update XX". After that you should add the JAVA_HOME environment to you system and JAVA_HOME\bin to your path. To do so in XP press Win + Brake, go to Advanced -> Environment Variables and add a new "System Variable" and enter JAVA_HOME and the directory of your java. In my case it looks like this: "C:\Program Files\java\jdk1.5.0_06". Afterwards, find the PATH variables and at add at the end a %JAVA_HOME%\bin entry.

Another thing to install is Tomcat and Ant which I will not get into to much detail. For Tomcat you have the option of a windows installer (I grabbed my 5.5 version here) and for ant you should simply download the latest binaries and uncompress them to the desired folder. After that you should repeat the same procedure as with the JAVA_HOME environment and PATH addition but with CATALINA_HOME and ANT_HOME, the former pointing the Tomcat home installation and latter to ant's.

Finally you need to download MySQL database. Although version 5 is available I downloaded version 4.1 since there seems to be more support so far. A good idea is to also download the Administrator and Query Browser.

Eclipse

Then we need a IDE for easier code writing, in this case eclipse. Eclipse is actually more than just an IDE, but a platform in itself. This is why you will not find a simple download for developing in Java. If you head to the download section you will see smacked in the middle of the screen the more "usual" download: the latest stable download for the eclipse SDK. This download includes the tools necessary to build plugins and expand eclipse, that since are written in Java, serves as an excellent Java IDE (actually the java tools are called Java development tools (JDT)).

Fortunate for me there was a new production release of what is known as the Web Tools Platform (WTP) a few weeks ago. This project aims helping the creation of J2EE and web projects and is bundled with several subproject and goodies that might prove useful in the future. So try and grab the latest version of the WTP and uncompress it to a folder and lunch eclipse.exe.

After you start eclipse, the first thing you should do is to set add the JDK as an installed JRE environment. For this, in eclipse, go to Windows -> Preferences. There, find the Java / Installed JRE entry in the left side tree and click on "Add". In the dialog presented enter any name you feel comfortable with (something like JDKJRE1.5.xx) and point to the same directory as the JAVA_HOME environment set earlier. Why eclipse is not smart enough to add this on its own? My guess is because it searches the Windows registry.

Most of the steps above are similar to what you can find here, but I found so much information on the page confusing for some reason.

AppFuse

As I said before, AppFuse is nice "template" project that help you get started on a new project. It uses Ant to its work, and what you end up having is a project with the name you assign to it in its own directory structure, ready to be built and deployed to a server. The standard tools AppFuse uses is ant and java, Tomcat as a web container and MySQL as its database. That is why with set up those things at the beginning. Also, the default architecture consists of hibernate+spring+struts with other assorted goodies. There are instructions at AppFuse wiki on how to configure these things differently but I haven't tried them yet. I’ll probably delve into this later since I want to use Tapestry instead of Struts.

Obviously the first thing to do is download the latest version and extract it to any directory. Then, with you command prompt pointing in the AppFuse directory type:

ant new

If you set everything alright it will be ask 1) the name of the application, 2) the database name and 3) the name of the packages. This will generate a directory with your project name that is ready to be built, tested and deployed.

Since AppFuse knows nothing about how do you wish to connect to your database you should supply these values by modifying build.properties file at the root of the new application directory. There, just unremark the lines with

database.admin.password=myrootpassword

After that, navigate to the new project directory and type

ant setup


This should build the DB, configure tomcat and deploy the resulting application. After this point you should be able to go to localhost:8080// and see a login page. Quite neat....

Since this blog entry is quite long so far, I will cut it here to return later and explore how AppFuse automates other development tasks and how to use Eclipse to edit the files.

Wednesday, March 29, 2006

Carnegie Mellon financing

The last couple of weeks have been kind of depressing. Getting admitted to CMU 's MSE and not being able to pay for the tuition was a real turn down. Thanks to the tremendous effort by my family, especially my parents and my sister I will probably going to be able to attend for the intensive 12-month course. The real problem was that since I'm an international student, securing a loan is very difficult, and in my home county there aren't any provisions for this sort of things. Fortunately, I have an uncle in the US that may be willing to lend a hand in case I need it.

While investigating for loans I found and interesting site called MyRichUnlce that lends money, but instead of repaying the loan the traditional way with a interest fee, you are bound to pay 1% of your salary for an X amount of time after graduation. Seems really interesting idea since these guys know that once you get your higher education your probably have better paying job opportunities.

The next step is to complete and submit the required forms, that include standard user forms and medical records and then wait for the I20 which will allow me to get my student Visa.

Sunday, March 19, 2006

Carnegie Mellon acceptance!!

Wow!! Today I received an acceptance letter from Carnegie Mellon Master in Software Engineering program. I'm ecstatic and really happy for the news. I remember taking the GRE 2 years ago in case I one day decided to got to a US school and also sending the application forms on december when I actually thought my chances where slim. I believe it was my work at my current company with CMM practices and belonging to the SEPG that helped. Anyways...it's going to be cool.

The only thing left now is to find financial support to go there since the Argentinean economic collapse 2 years ago has left the country (and my savings) with a devaluated 350%. A good salary development salary here is about U$S 18.000 a year. You do the math...So here I am analyzing my possibilities with a strong conviction to make it somehow (donations and loans accepted :) ).

And I haven't got into the difficulty that’s going to be surviving the program. I promise I'll keep posting how this process advances.

Friday, March 10, 2006

Web 2.0 rants

Hi couldn't help to marvel at what is going on with these new cool web 2.0 sites that are poping up everywhere. In only a year I realized I haven't almost installed any new rich client applications on my computer. I use Gmail to email and chats, Plaxo to have to store contacts and calendar events (but soon google will have a calendar too), bloglines for RSS, del.icio.us for bookmarks a of course blogger to blog about whatever is on my mind.

After the news spread about google buying writleyit seems we will not need office anymore. Google seems to be THE web company since they understand what the internet is all about. Anoter site that cought my atenttion today was thumbstacks, an online PowerPoint style program that looks promising.

I just can't wait to see what's next!

Tuesday, March 07, 2006

About DTO, ViewObjects and friends

A few weeks ago at the DDD forum a user (plind69) asked a question about how to send business objects to the presentation layer but have them show only a subset of data based on security settings. Needless to say, this is a much debated topic as witnessed by the large response and variety of opinions. Most solutions where based on the idea of DTOs, weather they are static or dynamic with proxies.

Users that had used DTO in a solution know how painful they can be: for starters DTOs are hard to maintain since every time a domain class changes so must the DTO (and also their assemblers/desassemblers). Then, there is this strange code-smell feelilng that you're duplicating code all over just for the presentation to use. To avoid this some suggest using dynamic DTOs (a nice dynamic DTO framework can be found here).

Although somewhat similar to dynamic DTO, some suggested using dynamic proxies to restrict the view. The solution looks promising for the particular issue of restrict certain fields, but I still believe that other issues should be accounted that are not possible to address with this particular implementation, like the fact that sometimes there are performance implications that make it undesirable to expose domain objects directly. Per example, imagine a fictional complicated purchase algorithm. If the result is calculated on the server, there is no need to send the actual value but a cached value. DTOs are perfect for the task since all its members are cached values. A DTO is basically only a cached set of data from the domain.

So, is there a solution? I don’t know J. First of all, let me tell you that I don't believe there is a silver bullet (at least not that I found) to solve this issues. I think that the mechanics of how to present domain classes to the user (or WS for that matter) should be considered on a use case-by-use case basis.

Maybe using a mix of adapter and proxy pattern could make life easier? A domain object could be proxified to return (or not according to security permissions) the information from the domain object itself, but if needed it could return a cached value. This could be similar to how you use a mock object but instead of creating all mock interfaces by default you pass in the actual domain object. So assuming you could do something like this:

VO viewObject = new VO(personRepository.ForId(1));
viewObject.cacheValue(“complexProperty”).returnValue(complexValue);
viewObject.restrictView(“restrictedProperty”).throwException(IllegalAccessException.Class);

In this way when you accessed regular properties or method, the information will be requested to the actual Person class; if you request a getComplexProperty you will be returned the cached value and if you request getRestrictedProperty you will get an IllegalAccessException. Also I don't think this approach is usuable in the case of Web Services (DTO seem more appropriate here).

So, what do you think? Is this practical or even possible? How do you feel about the different approaches?