Tuesday, July 27, 2010

Assignment:Case Study 5

EFI Send me Frameworks has a very interesting problem to solve. The UI of the application can be implemented for multiple platforms to name a few browser, wxWidget, MFC, Xwindows, etc. The application has 10 dialogs and each dialog has fixed number of controls on it. The controls can be like labels, text boxes, list boxes, buttons,etc. The idea is that anyone should be able to implement UI in their choice of technology. The application decides what control will be placed where and application also wants that some of the predefined events to be generated in response to the user input. Each Dialog is rendered based on the application intent, it means that if User Login Dialog needs to be rendered than application wants two labels, two text boxes and two buttons with Cancel and OK on it to be displayed. On click of Ok and Cancel the relevant events needs to be generated.

You need to design the application interface to support such a behavior. Don’t focus on events and layouts. What are the things you would consider when designing such a system? What all behavior you want to abstract? For people from .Net background, please focus on Web and Desktop solution.

The focus should be on creation and class hierarchy, don’t get lost with the function names and their signature.

Thursday, July 22, 2010

Assignment Day 3

Case Study 3

•A curve is defined by some finite points, each point is represented by an x and y value. Assume that the curve has about 1000 points
User wants to find points that meet the following criteria
–x> 2y
–y = x
– Y > x^2
–X is even
–Y is odd
–X= some value
–Y= some value
–X = some value + some other value * 5
In future we can have many more such operations to be performed on the curve.
Come up with the class diagrams or class declarations
-------------------------
Case Study 4

•I am working on an Imposition application where I have to provide some default layouts to the user that will place images on a page. The default layouts can be like lay all the images horizontally, vertically or in a table like format with n number of rows and m number of column or in a diagonal or around the perimeter of the page. Please come up with classes and their interaction. Assume that our graphics team is very creative and will come up with more of such layouts in future. Focus on Page and layouts.

Wednesday, July 21, 2010

Assignment Day 2

Case Study 1
•Rajneesh has approached you for help. He has one global object of each class A,B,C,D & E. He needs to ensure that they are created in the order they are listed and destroyed in the reverse order. He also shares with you that they have to be thread safe. Please suggest him.
-----------------------------------
* Think about the problems associated with Singleton and how can you resolve them...
* If the Manager class in your Code is a singleton evaluate and share the repercurssions of that decision. Does it in any way inhibit the future design changes? Under what circumstances will it become a bottleneck.?
-----------------------------------
Case Study 2
•Problem: Design a plugin framework such that anyone can write a reusable component that can be accessed by your application. To keep it simple let us only talk about database plugins that allow information to be written in various formats, like XML, SQL lite, Oracle, File, ODBC driver, OLE DB/ADO, basically anything that can persist the information. The focus should be how to instantiate such plugins.
----------------------------------
•Double Check Locking singleton (For Further Reading)

Sunday, July 18, 2010

Assignment Day 1:Sniffing

  1. The code has a lot of similar ifs at many places
  2. To fix a bug you have to apply the same fix at many places
  3. Your code has a lot ifs doing enum/type/string comparison to decide the function to be called for a particular object
  4. It is difficult to find out which function is called when
  5. Many classes in the code has more than 20 functions
  6. The number of classes with similar names is endless in your project
  7. Get/Set functions are virtual
  8. You can’t understand the purpose of the class by looking at its header file
  9. This is derived from that and that is derived from that and that is derived from that, so this and that have a ‘is a relationship’…didn’t get it…let us start again…
  10. Derived class doesn’t override even one virtual function defined in the base class
  11. Almost every new feature needs changes in at least 10% of the files in the project
  12. You can copy and paste the code Reviewer of the code always says, I am looking at this code for the first time…
  13. The number of Abstract classes…are you not able to find any?