Search This Blog

Showing posts with label oo. Show all posts
Showing posts with label oo. Show all posts

Wednesday, May 2, 2012

Another java practice from the past.

The task was to emulate work of simple IMDB database. Exercie during java course aimed to practice OO approach, some design patterns and mainly client - server relations. I'll update this post, because its main purpose to practice skills of correct presentation of my point of view on given subject, to practice myself in clarification of keypoints of given subject, and to give me another template on future topics. So here we are:

Revision 2 version as it was complete in august 2011:

IMDB R02 [till 12.08.2011].zip


Now, this is what it supposed to do:

figure 1
Flow chart.

Of course, the diagram above looks weird, but at least it is (in our reality this by itself is very much). Now we'll take another look on topic, t.i. from different point of view. Let's see the evolution of my approach to subject and, maybe, examine it closer/

Here are three previous "not published" versions:
IMDB R01.zip

moving further backward:
IMDB beta.zip

and finally first compilation:
IMDB alpha [till 05.08.2011].zip

As it could possibly be seen, the "evolution" of my thought was more like evolution of my laziness. Initially whole classwork was divided into two different ways: 1)constant predefined list, 2)dynamic factory pattern.
I took it way further and set my objective on achieving maximal object orientation and generalization. So, originally i strived to make everything generics, generics, generics, ... Object, Object, Object, Object, ... accepting Object-s, returning Object-s, everything in and out surrounded by patterns and  Reflection... .....
..... ..... .....
....
..
But, as exercise continued, the complexity and diversity of tasks, that i faced at this stage, has grown to impossible to maintain (at least for me) demand for keeping in mind and paying attention to whole process. So, instead of <Object> <Object, <Object, Object> ...> i got ...what i got. And in next projects i tried to advance gradually, thus achieving my aim step by step without overwhelming myself by "multiminding".


So, my main conclusion: "Make realistic plans. Or at least divide them into smaller ones."


P.S.: Looks like i found some bug in interaction between "Blogger" and "Docs" intefaces of google account. It seemed to be impossible for me to post an immage on Blogger via link from shared Docs of same account, and eventually i have been forced to upload it directly into post's body.
See you later.
:-]

Saturday, October 1, 2011

Practice OO approach and common design patterns.

When i started this "homework", i was among first. From the beginning, I set an aim to strive to be as much as possible object oriented (oo from here).  It turned out being almost too complicated task for me to achieve and when it still was in beginning, other students in my course have already completed entire project.But eventually i managed to finish the first task completely. So here we are.

Learned methods:
  • general reflection
  • reflection using parametrized constructors
  • Properties class usage
  • Decorator design pattern
  • threads VS static common methods
  • Reflection Factory  design pattern
  • multiple interfaces implementation.
  • Flyweight design pattern
  • Proxy design pattern
  • encapsulation design patterns e.g. wrappers, delegation, interfaces and inheritance
  • anonymous classes


Flowchart:








Here actual java project:

Nota bene:  built in Eclipse IDE


AV.AddressBook alpha [till 01.10.2011].zip 

It is well commented, especially in places where i wrote "IDK HOW TO DO IT!!!"
or "WHY THIS DOES NOT WORK???"

Code provided as is, so don't try to integrate this into life-supporting systems.
I know you want, but please, don't.


Learn in future how to:
  • implement arguments into main()
  • load at least one Plug-in
  • JDBC methods
  • unit testing
  • optimizations and more
farewell
;-]