How to design using patterns -


i college student , i'm learning software patterns (specifically ones mentioned in gof book). have never been @ software design, i'm learning how each pattern works , solves different problems produce more flexible software. have question has been bugging me.

what's best way @ problem (a piece of software needs written) , determine how organize , apply patterns? had group java project went sour because our design wasn't flexible. had great deal of trouble trying break down problem manageable pieces sort out. know can write code, don't know how organize it.

the patterns have gone through composite, builder, adapter, proxy, observer, state, strategy, template method, , iterator. have mentioned, know supposed solve, feel trying force patterns place. or links pages appreciated. thank all!

you mention issues basic application problem solving. need work on first before getting heavy patterns. patterns not way learn design - can add complexity , obscure design unless have advanced skills point.

work on decomposition of problem fundamental pieces , creating rational set of objects correspond domain knowledge , fundamental problem elements. also, create uml diagrams. don't have worry details of formal uml implementation, use basic blocks , associations represent model. don't try 1 diagram of entire app, diagram important pieces. diagramming improve ability visualize problem, how relates design, , process of translate problem model code , code model problem.

uml useful check , balance process. diagram should make logical sense. if cannot create logical diagram may have problem, , diagrams find pieces fit poorly. uml typically "leads" code in terms of clarity , complexity. mean diagram still reasonably clear past point when code becoming difficult work with. conversely, if diagram becoming complex or unclear dead give away resulting code potentially unmanageable , need rethink problem.

once feel getting better @ decomposing problem small parts , designing , naming classes fit analysis can begin incorporate patterns. start creation patterns first. many times singleton needed , applications of complexity can benefit appropriate use of factories.

after should able find more , more how structural patterns used. facade easy , 1 used - encapsulate lot of things simple interface. decorator, composite, proxy, adapter making object "type identity" appear behave differently, learn similarities between them , why each 1 different , apply them. finally, behavioral patterns typically used in either state management scenarios or sort of object - - object communication aspect. suggested types of problems, example memento suggested need perform roll backs or persist state.

work on basic design skills first, don't overdo patterns , incorporate them gradually, starting creational patterns first.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -